Missing memory: the size of the young generation includes only one space for survivors

In the Java heap, I expect the size of the young generation to be the sum of the dimensions of the eden space and both of the remaining living spaces (from space and space):

[young gen size] = [eden space size] + [from space size] + [to space size] 

However, GC magazines (using XX:+PrintHeapAtGC ) indicate that the size of the young generation is equal to the sum of the sizes of the eden space and only one of the surviving objects :

 [young gen size] = [eden space size] + [from space size] 

Why does the size of the young generation include only the size of one survivor?

Perhaps because only one of the surviving places is available at any time? But do both survivors exist, so what should both surviving spaces contribute to the size of the new generation?

Gc log:

 {Heap before GC invocations=48 (full 17): par new generation total 943744K, used 891496K [0x000000073ae00000, 0x000000077ae00000, 0x000000077ae00000) eden space 838912K, 100% used [0x000000073ae00000, 0x000000076e140000, 0x000000076e140000) from space 104832K, 50% used [0x000000076e140000, 0x000000077149a040, 0x00000007747a0000) to space 104832K, 0% used [0x00000007747a0000, 0x00000007747a0000, 0x000000077ae00000) 

Of what:

 [young gen size] = [eden space size] + [from space size] 943744K = 838912K + 104832K 
0
source share
1 answer

At any time, one of the remaining places is always empty, so it cannot be considered accessible.

+2
source

All Articles