生产中的Java G1垃圾收集 [英] Java G1 garbage collection in production

查看:95
本文介绍了生产中的Java G1垃圾收集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于Java 7将默认使用新的G1垃圾回收,因此Java能够处理大一个数量级的堆而不会造成破坏性的GC暂停时间?有没有人真的在生产中实现G1,你的经验是什么?

Since Java 7 is going to use the new G1 garbage collection by default is Java going to be able to handle an order of magnitude larger heap without supposed "devastating" GC pause times? Has anybody actually implemented G1 in production, what were your experiences?

公平地说,我看到真正长时间的GC暂停的唯一时间是非常大的堆,一台工作站会有。澄清我的问题; G1将打开通往数百GB的网关? TB?

To be fair the only time I have seen really long GC pauses is on very large heaps, much more than a workstation would have. To clarify my question; will G1 open the gateway to heaps in the hundreds of GB? TB?

推荐答案

这听起来像G1的一点是有较小的停顿时间,甚至到它有能力以指定一个最大暂停时间目标。

It sounds like the point of G1 is to have smaller pause times, even to the point where it has the ability to specify a maximum pause time target.

垃圾收集不仅仅是一个简单的嘿,它已经满了,让我们立刻移动所有东西,重新开始这是一个非常复杂,多层次的后台线程系统。它可以在后台执行大部分维护操作,而且不会暂停,并且它还可以在运行时使用系统预期模式的知识来帮助 - 例如假设大多数对象在创建后立即死亡等。

Garbage collection isn't just a simple "Hey, it's full, let's move everything at once and start over" deal any more--it's fantastically complex, multi-level, background threaded system. It can do much of its maintenance in the background with no pauses at all, and it also uses knowledge of the system's expected patterns at runtime to help--like assuming most objects die right after being created, etc.

我会说GC暂停时间将会继续改善,而不会随着将来的发布而恶化。

I would say GC pause times are going to continue to improve, not worsen, with future releases.

编辑:

在重新阅读时发现,我每天都会使用Java - Eclipse,Azureus和我开发的应用程序,而且自从我看到停顿之后,这种情况一直持续很长时间。

in re-reading it occurred to me that I use Java daily--Eclipse, Azureus, and the apps I develop, and it's been a LONG TIME since I saw a pause. Not a significant pause, but I mean any pause at all.

当我右键单击Windows资源管理器或偶尔挂上某些窗口时,我看到暂停USB硬件,但与Java ---根本没有。

I've seen pauses when I right-click on windows explorer or (occasionally) when I hook up certain USB hardware, but with Java---none at all.

GC仍然是一个问题吗?

Is GC still an issue with anyone?

这篇关于生产中的Java G1垃圾收集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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