JVM's proportion of the old and the new generation

 

In Java, the heap is divided into two distinct areas: the new generation (Young), years old (Old). New Generation (Young) are divided into three regions: Eden, From Survivor, To Survivor .
Thus divided JVM is designed to make the object to better manage heap memory, including memory allocation and recovery.
Heap memory model roughly as follows:

1

As can be seen from the figure: the new generation heap size = + years old. Wherein the heap size can be specified by the parameter -Xms, -Xmx.
By default, the new generation (Young) ratio year old (Old) value of 1: 2 (the parameter value may -XX: NewRatio specified), namely: (Young) = 1/3 new generation heap space size. Years old (Old) = 2/3 heap space. Wherein the new generation (Young) is subdivided into two Eden and Survivor regions, two regions were designated as Survivor from and to, to show distinction.
Default, Eden: from: to = 8 : 1: 1 ( by parameter -XX: setting SurvivorRatio), namely: Eden = 8/10 new generation space, from = to = 1/10 new generation size of space.
JVM will use every Survivor Eden and a region which is subject to the service, so no matter what, there is always a Survivor of the area is free.
Thus, the new generation of memory space actually available 9/10 (i.e. 90%) of the new generation space.

In Java, the heap is divided into two distinct areas: the new generation (Young), years old (Old). New Generation (Young) are divided into three regions: Eden, From Survivor, To Survivor .
Thus divided JVM is designed to make the object to better manage heap memory, including memory allocation and recovery.
Heap memory model roughly as follows:

1

As can be seen from the figure: the new generation heap size = + years old. Wherein the heap size can be specified by the parameter -Xms, -Xmx.
By default, the new generation (Young) ratio year old (Old) value of 1: 2 (the parameter value may -XX: NewRatio specified), namely: (Young) = 1/3 new generation heap space size. Years old (Old) = 2/3 heap space. Wherein the new generation (Young) is subdivided into two Eden and Survivor regions, two regions were designated as Survivor from and to, to show distinction.
Default, Eden: from: to = 8 : 1: 1 ( by parameter -XX: setting SurvivorRatio), namely: Eden = 8/10 new generation space, from = to = 1/10 new generation size of space.
JVM will use every Survivor Eden and a region which is subject to the service, so no matter what, there is always a Survivor of the area is free.
Thus, the new generation of memory space actually available 9/10 (i.e. 90%) of the new generation space.

Guess you like

Origin www.cnblogs.com/shoshana-kong/p/11314677.html