JVM memory zoning summary

I found online There are two versions of the JVM memory division, one is in accordance with the "in-depth understanding of JVM virtual machine" version, including the program counter, etc., divided according to whether threads share.

I think some of the other more memorable, more suitable for myself, here to record it.

First on mind mapping:

One for the road now.

Heap memory heap

The main heap memory is divided into a new generation and the old year (about the same meaning)

Substantially all of the object instances are created in the heap, the heap memory, so often GC recovery operation occurs. A new object in Eden assigned area, only two regions Surviior Eden as a buffer zone to use. Each time a GC recovery, +1 the age value of the object, when the object area Survivor age value is greater than 15 (default, can be changed: -XX: MaxTenuringThreshold), was transferred to the old year.

Under the new generation is divided into three regions, i.e. Eden Space, To Survivor, From Survivor. 1/3 heap memory occupied by the new generation, and memory usage three areas as shown below:

 

 JVM default allocation ratio and Old Yong 1: 2, i.e. the new generation memory heap size 1/3.

Adjust parameters: -XX: NewRatio

And the new generation, Eden, from, default scale to as 8: 1: 1, JVM will only use a Survivor each area to serve as an object, so, no matter when, there is a free area Survivor

Adjust parameters: -XX: SurvivorRatio 

 

Old age memory size for the remaining 2/3

 

Guess you like

Origin www.cnblogs.com/yuan-zhou/p/11311210.html