-xms128m JVM Initial allocation of heap memory
-XMX512M JVM Maximum allowable allocated heap memory, on demand
-xx:permsize=64m JVM Initial allocation of non-heap memory
-xx:maxpermsize=128m JVM Maximum allowable allocated non-heap memory, on demand
The initial allocated heap memory of the JVM is specified by-XMS, and the default is the maximum allocated heap memory for 1/64;JVM of physical memory specified by-XMX, which defaults to 1/4 of the physical memory. When the default free heap memory is less than 40%, the JVM will increase the heap until the maximum limit of-xmx;
When free heap memory is greater than 70%, the JVM will reduce the heap until the minimum limit of-XMS. So the server generally sets-xms,-xmx equal to avoid resizing the heap after each GC.
The initial allocated heap memory of the JVM is specified by-XMS, and the default is the maximum allocated heap memory for 1/64;JVM of physical memory specified by-XMX, which defaults to 1/4 of the physical memory. When the default free heap memory is less than 40%, the JVM will increase the heap until the maximum limit of-xmx;
When free heap memory is greater than 70%, the JVM will reduce the heap until the minimum limit of-XMS. So the server generally sets-xms,-xmx equal to avoid resizing the heap after each GC.
If the non-heap allocation
Xx:maxpermsize set too small will cause java.lang.OutOfMemoryError:PermGen space is memory benefits.
Setting the VM parameters causes the program to fail to start for several reasons:
1) The value of-XMS in the parameter is greater than-XMX, or the value of-xx:permsize is greater than-xx:maxpermsize;
2) The sum of-XMX values and-xx:maxpermsize exceeds the maximum limit of JVM memory, such as the maximum memory limit of the current operating system, or actual physical memory, and so on. When it comes to physical memory, it's important to note that
If your memory is 1024MB, but the actual system used is not likely to be 1024MB, because a part of the hardware is occupied.
Xms Xmx permsize maxpermsize Difference