Jdk1.6 memory format

I am using jdk1.6. I configure Xmx = 2G, Xms = 2G, NewSize = MaxNewSize = 660 m

I include verbose gc. I see this, which I do not underestimate:

PSYoungGen total 608256K, used 32440K eden space 540672K, 6% used from space 67584K, 0% used to space 67584K, 0% used 

According to my configuration, the size of YoungGen is 675840 MB. Since younGen = Eden + two survivors,

GC log saying my size is YoungGen = 608256K, which I did not configure. Also, if I add the Eden space and the two survivors, I get 540672K + 67584K + 67584K = 675840K

which is also not true.

But Eden + 1 Survivor space = 540672K + 67584K = 675840K, which I configured. Does this mean that YoungGen = Eden + 1 Survivor space? I think there are two survivors, right?

Please explain me.

thank you

+2
source share
1 answer

There are two survivors, but only one is used at any given time; objects move back and forth from one place for survivors to another every time there is a collection of garbage from the younger generation. Thus, your tuned space of the young generation is equal to the space with eden plus one of the survivors; the other is basically just overhead.

+1
source

Source: https://habr.com/ru/post/1412691/


All Articles