JDK memory
The jdk memory is actually the jvm memory. The jvm has a runtime data area, which is actually the size allocation of this part.
The runtime data area usually includes these parts: Program Counter Register, Java Stack (VM Stack), Native Method Stack (Native Method Stack), Method Area (Method Area), Heap (Heap)
- Xss: stack size of each thread (stack)
- Xmx: The maximum value of JAVA HEAP, the default is 1/4 of the physical memory
- Xms: The initial value of JAVA HEAP, the best Xms on the server side is the same as Xmx
- Xmn: Size of JAVA HEAP young area
- XX:PermSize: Set the permanent storage area of the memory
- XX:MaxPermSize: Set the permanent storage area of the maximum memory
In JDK1.8, PermGen was cancelled and replaced by Metaspace, so the PermSize and MaxPermSize parameters were invalid, and replaced by
-XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m
Modify JDK memory
Under linux: edit catalina.sh in the bin directory of tomcat
cygwin=false added above
JAVA_OPTS="-Xms1024m -Xmx2048m -Xss1024K -XX:MetaspaceSize=512m
-XX:MaxMetaspaceSize1024m"
refer to: