Skip to content

Tag: performance

The Running Time For Arrays.Sort Method in Java

Does anyone know the running time in big O notation for the arrays.sort java method? I need this for my science fair project. Answer From official docs I’ve observed that there are primarily two approaches. So, it depends on what you are sorting and what overloaded method from sort family of methods you…

Calculate average of a huge long array

I’m trying to calculate the average of many (more than 200) long (primitive type) values stored in an array. Usually you add all the numbers and divide it by the number of the values. But this is not possible in this case since there is no primitive datatype in Java capable of holding such a large numbe…

Java Virtual Machine Heap Tuning Parameters

What would be the effect of setting only -Xms without setting a -Xmx for eg. java -Xms 2048m ? Does setting a high lower value for -Xms mean lesser Heap Fragmentation? Answer Setting -Xms to the estimated heap requirement of your application will speed up start of your application (of course Xms must be <=…