This topic provides a reference for configuring JVM parameters.
As a best practice, the total memory occupied by JVM processes does not exceed 80% of the total memory. The total memory includes heap, metaspace, off-heap memory, and code cache.
The JVM parameters in the following table are for reference only. We recommend that you set the parameter values based on stress test results.
JVM parameter | Description | 1C 2G | 2C 4G | 4C 8G | 8C 16G |
-Xms | The initial size of the heap memory | 1G | 2560M | 4G | 10G |
-Xmx | The maximum size of the heap memory | 1G | 2560M | 4G | 10G |
-Xmn | The size of the young generation space | 500M | 1200M | 2G | 5G |
-Xss | The size of the thread stack space (Default value for JDK 8: 1M) | 1M | 1M | 1M | 1M |
-XX:MetaspaceSize | The initial size of the metaspace | 128M | 256M | 384M | 512M |
-XX:MaxMetaspaceSize | The maximum size of the metaspace | 128M | 256M | 384M | 512M |
-XX:MaxDirectMemorySize | The maximum size of the off-heap memory | 256M | 256M | 1G | 1G |
-XX:ReservedCodeCacheSize | The size of the code cache | 64M | 128M | 256M | 256M |