JDK 12 正式收录了我们的 Patch

国庆假期归来就收到喜讯,之前给社区提交的patch( PerfMa给OpenJDK社区提交的第一个Patch )已经正式收录到JDK12了(点击“阅读原文”,可查看详情),非常感谢社区的小伙伴的积极配合,从提交issue开始到正式修复并打入JDK12耗时才10天的时间,这个效率已经挺赞了,测试用例还是社区小伙伴给写的,PerfMa会和社区不断保持联系,贡献出我们的一份力量,服务好Java小伙伴们。

JDK 12 正式收录了我们的 Patch

JDK 12 正式收录了我们的 Patch

另外第二个Patch( 假笨说-Metaspace使用很少就触发了Full GC?(第二个社区Patch) )考虑到会修改一些语义,和之前的一些GC日志表达上会不一致,和我之前的考虑有些类似,因此可能不太会考虑我的提议,虽然他们也认同我的考虑,下面是社区给的回复:

FWIW, I agree this is confusing, and personally would prefer the
committed size be printed as you suggests, but I guess this may break
a lot of tooling.

Note that the gap between committed and used can be quite large in the
following pathological scenarios:

a) lots of class loaders which do not load many classes and stop
loading classes at an inconvenient time: when having been handed a
larger memory chunk after having used up four small chunks - which the
JVM takes as proof that this classloader is here to stay and therefore
may just as well get a large chunk to gnaw on.
This leads to fragmentation and there is no easy way to avoid it. We
can play around with chunk sizes and allocation strategies but there
will always be pathological scenarios since the JVM needs to guess and
may guess wrongly.

b) when class loaders died and their memory chunks are returned to the
internal metaspace freelists. They are not always uncommitted
immediately; in fact they never may be uncommitted. They will be
reused when other classloaders load classes, which may never happen.

Note: to analyze these situations better we (SAP) added a new command
to jcmd, "VM.metaspace". Among other things, the command outputs a
"Waste" section, which details both (a) and (b) and some minor other
waste scenarios. That command is now upstream in stock OpenJDK, so it
should be available in jdk11.

Thanks, Thomas

相关链接

感谢OpenJDK官方社区的反馈,官方已建立issue

PerfMa给OpenJDK社区提交的第一个Patch

假笨说-Metaspace使用很少就触发了Full GC?(第二个社区Patch)

欢迎各位关注个人微信公众号,主要围绕JVM写一系列的原理性,性能调优的文章,也可以关注我们公司的公众号

JDK 12 正式收录了我们的 Patch

JDK 12 正式收录了我们的 Patch

原文 

https://mp.weixin.qq.com/s/CUQ9rqrrcaOvrPcWN7qzJg

本站部分文章源于互联网,本着传播知识、有益学习和研究的目的进行的转载,为网友免费提供。如有著作权人或出版方提出异议,本站将立即删除。如果您对文章转载有任何疑问请告之我们,以便我们及时纠正。

PS:推荐一个微信公众号: askHarries 或者qq群:474807195,里面会分享一些资深架构师录制的视频录像:有Spring,MyBatis,Netty源码分析,高并发、高性能、分布式、微服务架构的原理,JVM性能优化这些成为架构师必备的知识体系。还能领取免费的学习资源,目前受益良多

转载请注明原文出处:Harries Blog™ » JDK 12 正式收录了我们的 Patch

赞 (0)
分享到:更多 ()

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址