jdk8 memory parameter analysis and modification

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:

Introduction to JVM

JVM memory area division

Java memory area and memory overflow

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324943883&siteId=291194637