全GC当许多对象年龄> = 15但不是长寿命的对象时?

发布于 2025-02-08 02:44:43 字数 964 浏览 0 评论 0原文

我的Java应用程序经常使用完整的GC

通过分析GC日志,我发现有许多年龄的物体= 15。我想许多物体在达到MaxteningThreshold = 15后已将其晋升为老年,这导致终身一代越来越大。最后,全GC 发生了。

但是,借助gceasy工具,我发现旧一代还通过完整的GC回收了很多垃圾。大约2390-> 800。

原因是什么?是因为有很多年龄的物体> 15不属于终身一代?也许他们的年龄= 16,17,18?但是不是长寿命的对象吗?

这是我的JVM配置:

-Xmx6g
-Xms6g
-XX:NewRatio=1
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:MaxTenuringThreshold=15
-XX:+ParallelRefProcEnabled
-XX:+CMSParallelRemarkEnabled
-XX:+UseCMSCompactAtFullCollection
-XX:+HeapDumpOnOutOfMemoryError
-XX:MetaspaceSize=512m
-XX:MaxMetaspaceSize=512m
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-Xloggc:/export/Logs/gc.log
-XX:+PrintTenuringDistribution
-XX:SurvivorRatio=4 

年龄分布

​/a>

在这种情况下,如何调整JVM?

谢谢你!

My java applications frequently use full GC.

By analyzing gc log, I found that there were many objects with age >= 15. I guess that many objects were promoted to the old age after reaching maxtenuringthreshold=15, which led to the tenured generation becoming larger and larger. Finally, full GC occurred.

But with the help of gceasy tool, I found that the old generation also recycled a lot of garbage through full GC. About 2390 -> 800.

What is the reason? Is it because there are many objects with age > 15 that do not belong to the tenured generation? Maybe their age =16,17,18? But not long-live objects?

Here is my JVM configuration:

-Xmx6g
-Xms6g
-XX:NewRatio=1
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:MaxTenuringThreshold=15
-XX:+ParallelRefProcEnabled
-XX:+CMSParallelRemarkEnabled
-XX:+UseCMSCompactAtFullCollection
-XX:+HeapDumpOnOutOfMemoryError
-XX:MetaspaceSize=512m
-XX:MaxMetaspaceSize=512m
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-Xloggc:/export/Logs/gc.log
-XX:+PrintTenuringDistribution
-XX:SurvivorRatio=4 

Age distribution

Old generation

Avg promotion rate

In this case, how can I tune the JVM?

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文