jdk1.6内存布局 [英] jdk1.6 memory layout

查看:357
本文介绍了jdk1.6内存布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jdk1.6。我配置
Xmx = 2G,Xms = 2G,NewSize = MaxNewSize = 660m

我启用详细的gc。我看到这我不undertsnaidng:

  PSYoungGen总计608256K,使用32440K 
eden空间540672K,使用6%
来自空间67584K,0%使用
到67584K空间,0%使用

根据我的配置,YoungGen的大小是675840MB。
因为younGen =伊甸园+两个幸存者空间,所以

GC日志说我的YoungGen大小= 608256K这不是我配置的。
另外,如果我添加Eden空间和两个生存空间,我得到
540672K + 67584K + 67584K = 675840K

这也是错误的。 p>

但是Eden + 1幸存者空间= 540672K + 67584K = 675840K,我已经配置了。
那么这是否意味着YoungGen = Eden + 1幸存者空间?我认为有
两个幸存者空间,对吗?



请解释我。



感谢您

解决方案

有两个幸存者空间,但在任何给定时间只有一个空间;每当有年轻一代的垃圾收集时,物体就会从一个幸存者空间来回移动到另一个。因此,您配置的年轻一代空间等于伊甸园空间加上一个的幸存空间;另一个基本上只是开销。


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

解决方案

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.

这篇关于jdk1.6内存布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆