G1GC还没有正式量产吗?
我想知道 JDK 7 版本中“垃圾优先”(G1)收集器的官方地位是什么。我想使用 G1 作为 CMS 的低暂停 gc 替代品,但前提是我真正信任它的稳健性。
在 JDK 7 发布之前,G1 被宣传为闪亮的新 gc 将取代 CMS 收集器,甚至成为 JDK 7 中的默认 gc。但是,现在使用 Oracle JDK 7u1,G1 不再是我拥有的任何计算机上的默认 gc尝试过。
尽管在 JDK 7 中使用 -XX:+UseG1GC
时不再需要指定 -XX:+UnlockExperimentalVMOptions
,但它是一项官方完全未记录的 JVM 功能:
我能找到的唯一提到 G1 的官方文档已经严重过时了,并且是在 JDK 7 发布之前很久就编写的:
http://www.oracle.com/technetwork/java/javase/tech/g1-intro-jsp-135488.html
例如,官方的“Java HotSpot VM Options”文档( http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html )记录了如何启用和调整其他收集器,但甚至没有提及G1。就好像它不存在一样!
这是相当令人困惑的,我想知道G1的真实状况是什么以及它的未来是什么。真的还稳定吗?剩下的问题(例如泄漏、虚假崩溃和缺少仪器支持)是否得到解决?如果是这样,为什么 Oracle 将 G1GC 视为未记录的(令人尴尬的?)秘密? G1 或许是一个失败的项目,现在已经悄然中止了?或者我需要支付文档和支持费用吗?或者它还只是测试版?有人可以告诉我这里发生了什么吗?
I wonder what the official status of the "garbage first" (G1) collector in the JDK 7 release is. I would like to use G1 as a low pause gc alternative to CMS, but only if I can really trust on its robustness.
Before JDK 7 was out, G1 was advertised as the shiny new gc going to replace the CMS collector and even to be the default gc in JDK 7. However, now with Oracle JDK 7u1, G1 is not the default gc on any machine I have tried.
Even though one does not need to specify -XX:+UnlockExperimentalVMOptions
anymore when using -XX:+UseG1GC
in JDK 7, it's a JVM feature that's officially completely undocumented:
Java 7 (JDK 7) garbage collection and documentation on G1
The only official document I could find that mentions G1 is seriously outdated and was written long before JDK 7 was out:
http://www.oracle.com/technetwork/java/javase/tech/g1-intro-jsp-135488.html
For example, the official "Java HotSpot VM Options" documentation ( http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html ) documents how to enable and tune the other collectors but does not even mention the existence of G1. As if it didn't exist!
This is quite confusing and I wonder what the real status of the G1 and what its future is. Is it really stable yet? Have the remaining issues (like leaks, spurious crashes and missing instrumentation support) been resolved? And if so, why does Oracle treat the G1GC as an undocumented (embarrassing?) secret? Is G1 perhaps a failed project that's now silently discontinued? Or do I need to pay for documentation and support? Or is it just still beta? Can someone enlighten me on what's going on here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
提出这个问题的地方是 hotspot-gc-dev 邮件列表。
如果您查看档案,您会发现有一个很多工作正在进行中。很多邮件似乎都是提交和审查请求/评论,因此他们正忙于处理它。
我没有找到任何官方新闻公告,但这就是Oracle的运作方式。如果您对其中一位开发人员的非官方且不具约束力的评论感到满意,您可以在该邮件列表上询问他们认为进展如何。
编辑:@scravy发送一封电子邮件发送到邮件列表,这是收到回复:
编辑:根据 Oracle 网站上的此链接 看起来 G1GC 现在已经完全支持了。
The place to ask this question is on the hotspot-gc-dev mailing list.
If you look through the archives you'll find that there is a lot of work being done. A lot of the mail appears to be commits and review requests/comments so they're busy working on it.
I haven't found any official news announcements, but that is how Oracle works. You might be able to ask on that mailing list how they think they're going, if you're happy with an unofficial and non-binding comment from one of the devs.
EDIT: @scravy sent an email to the mailing list, this is the response received:
EDIT: According to this link on Oracle's site it looks like G1GC is now fully supported.
我们已经使用 G1GC 近一年半了。它在我们的关键任务事务处理系统中表现出色,并且事实证明它对高吞吐量、低暂停、并发、多线程和优化的重内存管理提供了很好的支持。
我们使用以下 JVM 设置:
We are already using G1GC, from almost a year and half. Its doing great in our mission critical transaction processing system, and It proved to be a great support w.r.t high throughput, low pause, concurrency, multi-threading and optimized heavy memory management.
We are using following JVM settings:
据此: http://www.oracle .com/technetwork/java/javase/tech/g1-intro-jsp-135488.html,
此外,
因此,当官方 JDK SE 7 发布时,G1 应该会取代 CMS。
According to this: http://www.oracle.com/technetwork/java/javase/tech/g1-intro-jsp-135488.html,
Also,
So G1 is supposedly going to replace CMS when the official JDK SE 7 is out.
AFAIK,G1 并不是秘密——它已经开放供实验使用足够长的时间——至少一两年。每个 JavaOne 都带有一些关于 G1 有多好的文章:)
来自非官方来源:它是 java 工程师当前关注的焦点之一,最终使 G1 生产做好准备。他们只是还没有准备好为 JDK 7 打开它。请继续等待:)
AFAIK, G1 is not secret -- it's open for experimental use long enough -- at least year or two. Every JavaOne comes with some lection about how good G1 will be :)
From unofficial sources: it's one of current focuses for java engeneers, to make G1 production ready at last. They just was not ready to open it for JDK 7. Just keep waiting :)
它看起来像问题中链接的页面 已更新:
(但请注意,对于像 ARM 这样的嵌入式平台,7u4 中尚不支持它。)
It looks like the page linked in the question has been updated:
(Note, however, that for embedded platforms like ARM, it is not yet supported at all in 7u4.)
自 Java 7 update 4 版本发布以来,G1 GC 已做好生产准备。
从 oracle 文章(在 G1 垃圾收集器下),您可以找到G1 GC 的真实用例。
查看相关问题,了解有关 G1GC 的更多详细信息以及需要微调的关键参数:
Java 7 (JDK 7) 垃圾关于 G1 的收集和文档
关于您的其他疑问:
G1 GC is production ready since Java 7 update 4 version launch.
From oracle article (under The G1 Garbage Collector), you can find real use cases for G1 GC.
Have a look at related question for more details about G1GC and key parameters to be fine tuned:
Java 7 (JDK 7) garbage collection and documentation on G1
Regarding your other queries: