What is a JVM?
Virtual machine, byte code, platform Independent
The JVM divides the memory structure according to the storage structure of the runtime data, and the JVM divides them into several different data formats when operating Java programs, which are stored in different regions, which are collectively known as runtime data. Runtime data includes the data information of the Java program itself and the additional data information that the JVM needs to run Java.
JVM Heap Configuration parameters
1-xms Initial Heap Size
1/641 of default physical memory (<1G)
2-XMS Maximum Heap Size
The default physical memory of the quarter (<1GB), the actual recommendation is not less than 4G.
3 General recommended settings-xms=-XMX
The benefit is to avoid resizing the heap every time after GC, reducing the system memory allocation overhead
4 size of the entire heap = young generation size + old generation size + persistent generation size.
JVM Memory Structure
New generation of JVM (young generation)
Cenozoic = 1 Eden Zone + 2 survivor area
-xmn Young generation size (1.4 or Lator)
-xx:newsize,-xx:maxnewsize (set young generation size (for1.3/1.4))
The default size is 3/8 of the entire heap
-xx:newratio
Ratio of young generations (including Eden and two survivor districts) to older generations (excluding persistent generations)
Xms=xmx and the xmn is set, this parameter does not need to be set.
-xx:survivorratio
The ratio of the Eden area to the Survivor area is set to 8, then the ratio of two survivor area to one Eden area is 2.8, and one survivor area represents 1/10 of the entire young generation.
Used to store Java objects just allocated by the JVM.
Java Persistence generation (perm Generation)
1. Generation = Entire Heap-young generation size-old age size
1.
1.java application JVM principle and parameter tuning