Adjusting the Thread Stack Size
Principles
In the x86 system, the default thread stack size of the JVM is 1 MB. In the Kunpeng system, the default thread stack size of the JVM is 2 MB. When the number of threads is the same, the memory consumed by the Kunpeng system is twice that consumed by the x86 system. If the system memory is insufficient, you can use the -Xss parameter to set the thread stack size to reduce memory usage.
Modification Method
Use the -Xss parameter to modify the thread stack size when the Java process is started. The following is an example of setting the stack size to 1 MB:
1 | # /path/java -Xss1024k <other parameters>
|
If the stack size is too small, stack overflow may occur, affecting service code running. You need to evaluate the stack size based on the service function calling characteristics.
Parent topic: Tuning Methods