How to tune JVM memory?

Parameters

The parameters to be tuned are in the conf/jvm.conf file. Some are already present, and some need to be added in order to be tuned.


Parameter name Default value Role Example
-Xms 512M Startup memory space for the application. Should not be changed, or set the same value than Xmx to allocate the whole application data memory at startup -Xms1G
-Xmx 6G

Maximum memory space for the application data that is composed of:

  • cache of persisted data
  • transient data for query executions
  • other runtime data

If at a given instant this memory space is undersized then one of the following exceptions will be thrown:

java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: GC overhead limit exceed 

-Xmx8G
-XX:NewRatio 2

Use the following table to use the adequate value (some software architecture changes may revise this table later)

-Xmx
4G to 8G 2 (default value)
8G to 12G 3
12G to 16G 4
>16G 5
-XX:NewRatio=4

Related Links