jdk1.6 memory layout

删除回忆录丶 提交于 2019-12-11 01:02:33

问题


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

I enable verbose gc. I see this which I am not undertsnaidng:

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

According to my configuration YoungGen size is 675840MB. Because younGen = Eden + two survivor spaces,

GC log saying that my YoungGen size = 608256K which is not what i've configured. Also if I add Eden space and two survivor spaces I am getting 540672K + 67584K + 67584K = 675840K

which is also wrong.

But Eden + 1 Survivor space = 540672K + 67584K = 675840K, what i have configured. So does this mean that YoungGen = Eden + 1 Survivor space? I think there are two survivor space, correct?

Please explain me.

thanking you


回答1:


There are two survivor spaces, but only one is used at any given time; objects get moved back and forth from one survivor space to the other every time there's a young-generation garbage-collection. So your configured young-generation space is equal to the eden space plus one of the survivor-spaces; the other is basically just overhead.



来源:https://stackoverflow.com/questions/9896729/jdk1-6-memory-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!