Configure the jvm settings in the
jvm.options settings file.
Here are some tips for adjusting the JVM heap size:
- The recommended heap size for typical ingestion scenarios should be no less than 4GB and no more than 8GB.
- CPU utilization can increase unnecessarily if the heap size is too low, resulting in the JVM constantly garbage collecting. You can check for this issue by doubling the heap size to see if performance improves.
- Do not increase the heap size past the amount of physical memory. Some memory must be left to run the OS and other processes. As a general guideline for most installations, don’t exceed 50-75% of physical memory. The more memory you have, the higher percentage you can use.
- Set the minimum (Xms) and maximum (Xmx) heap allocation size to the same value to prevent the heap from resizing at runtime, which is a very costly process.
You can make more accurate measurements of the JVM heap by using either the
jmapcommand line utility distributed with Java or by using VisualVM. For more info, see Profiling the Heap.
Large configurations may require additional JVM stack memory.
If you see a stack overflow error, try increasing the JVM stack size.
Add an entry similar to this one in the
Note that the default stack size is different per platform and per OS flavor. You can find out what the default is by running:
java -XX:+PrintFlagsFinal -version | grep ThreadStackSize
Depending on the default stack size, start by multiplying by 4x, then 8x, and then 16x until the overflow error resolves.