简体   繁体   English

jdk1.6内存布局

[英]jdk1.6 memory layout

i am using jdk1.6. 我正在使用jdk1.6。 I configureg Xmx = 2G, Xms= 2G, NewSize = MaxNewSize = 660m 我配置了Xmx = 2G,Xms = 2G,NewSize = MaxNewSize = 660m

I enable verbose gc. 我启用了详细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. 根据我的配置,YoungGen大小为675840MB。 Because younGen = Eden + two survivor spaces, 因为younGen = Eden +两个幸存者空间,

GC log saying that my YoungGen size = 608256K which is not what i've configured. GC日志说我的YoungGen大小= 608256K,这不是我配置的大小。 Also if I add Eden space and two survivor spaces I am getting 540672K + 67584K + 67584K = 675840K 另外,如果我添加伊甸园空间和两个幸存者空间,我将得到540672K + 67584K + 67584K = 675840K

which is also wrong. 这也是错误的。

But Eden + 1 Survivor space = 540672K + 67584K = 675840K, what i have configured. 但是我已经配置了伊甸园+ 1个幸存者空间= 540672K + 67584K = 675840K。 So does this mean that YoungGen = Eden + 1 Survivor space? 那么这是否意味着YoungGen = Eden + 1 Survivor空间? I think there are two survivor space, correct? 我认为有两个幸存者空间,对吗?

Please explain me. 请给我解释一下。

thanking you 感谢您

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. 另一个基本上只是开销。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM