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

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

问题描述

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



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



为什么GC没有清理终身代?



解决方案

这是一个完全预期的和期望的行为。 JVM一直通过及时执行Minor GC来成功避免重大GC。按照定义,小型GC不会触及Tenured Generation,而世代垃圾收集器背后的关键思想就是这种模式正是出现。

您应该非常满意以及您的应用程序如何嗡嗡作响。


Context: 64 bit Oracle Java SE 1.8.0_20-b26

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.

Why does the GC not clean up the 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天全站免登陆