为什么 java8 GC 超过 11 小时不收集? [英] Why does the java8 GC not collect for over 11 hours?

查看:23
本文介绍了为什么 java8 GC 超过 11 小时不收集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文:64 位 Oracle Java SE 1.8.0_20-b26

Context: 64 bit Oracle Java SE 1.8.0_20-b26

11 多个小时以来,我正在运行的 java8 应用程序一直在 Tenured 一代中积累对象(接近 25%).因此,我手动点击了 jconsole 中的 Perform GC 按钮,您可以在图表右侧看到堆内存的急剧下降.除了 XX:NewRatio=2 之外,我没有打开任何特殊的 VM 选项.

For over 11 hours, my running java8 app has been accumulating objects in the Tenured generation (close to 25%). So, I manually clicked on the Perform GC button in jconsole and you can see the precipitous drop in heap memory on the right of the chart. I don't have any special VM options turned on except for XX:NewRatio=2.

GC为什么不清理tenured generation?

Why does the GC not clean up the tenured generation ?

推荐答案

这是一个完全预期和理想的行为.JVM 一直通过及时执行 Minor GC 成功地避免了 Major GC.根据定义,Minor GC 不会触及 Tenured Generation,而分代垃圾收集器背后的关键思想正是这种模式将会出现.

This is a fully expected and desirable behavior. The JVM has been successfully avoiding a Major GC by performing timely Minor GC's all along. A Minor GC, by definition, does not touch the Tenured Generation, and the key idea behind generational garbage collectors is that precisely this pattern will emerge.

您应该对您的应用程序运行良好感到非常满意.

You should be very satisfied with how your application is humming along.

这篇关于为什么 java8 GC 超过 11 小时不收集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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