Priyanka Priyanka - 4 months ago 37
Java Question

JMeter: How much java heap size one can increase for 64 bit windows OS

To avoid

OutOfMemoryException
in JMeter, I am increasing heap size to -Xms5120m.

I would like to know how much I can increase Java heap size?

Answer

With a Java 64 bits, you can increase heap to whatever you want provided you follow the following rules:

  • Don't exceed you RAM, and keep enough memory for the OS, so your heap should be RAM minus what OS and other software use. This is to ensure your machine does not swap.

  • Whenever you have big JVMs (> 4 GB), you may start facing big GC pauses which will required GC Tuning which is very complex. As a rule of thumb use the latest Java version (currently Java 8) and the G1 GC algorithm (using -XX:+UseG1GC).

Finally, with JMeter there is no reason to increase the heap too much, provided you follow best-practices: