Tomcat垃圾收集频率 [英] Tomcat garbage collecting frequency

查看:131
本文介绍了Tomcat垃圾收集频率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java新手,并且刚刚继承了Tomcat设置,所以我希望有一些指导:)上周我已经阅读了有关JVM调优和垃圾收集算法的更多内容, p>

使用Visual VM / GC,我们的Tomcat服务器每天只进行一次全面的GC。鉴于大多数用户的网络会话持续时间不到一小时,这对我来说似乎很少见,而且很可能很长时间以来,烫发会有很多死的对象?那么这是否意味着我们有足够的RAM /堆空间,并且它根本不需要收集,所以它不会?

鉴于此,促使老一代变得更小,新一代变得更大,因为促销率很小?

我在问,因为操作系统其他地方有迹象表明我们可能有内存压力,但JVM / GC日志似乎与操作系统相矛盾。



与此相关 -



我们目前有 min-heap = max-heap = 6Gb 。如果 top 显示的java进程大小为7-8Gb,但RSS大小为5-6Gb,这可能意味着2Gb被换出了?在这种情况下,当它完整的GC时它就会死亡。因此,在操作系统交换出来之前,更小的最小堆大小是更好的选择。



通常最好让JVM自己调整自己而不是手动设置所有参数,或者大多数人手动设置参数? 解决方案

你是什么版本的Tomcat使用?



内存泄漏防护gubbins存在一个错误,导致小时内
完整的GC:

https://issues.apache.org/bugzilla/show_bug.cgi?id=53267



(请注意,bug在tomcat7上提及它,但6也会受到影响,在6.0.36中修复)

I'm new to Java, and have just inherited a Tomcat setup so I'd like some guidance :) I've read more in the last week about JVM tuning and garbage collecting algorithms than I would like to!

Using Visual VM/GC our Tomcat servers are doing full GC's less that once a day. Given that most users web sessions last less than an hr, this to mee seems very infrequent, and presumably there are a lot of "dead" objects in perm gen for a long time? So does this just mean that we have plenty of RAM/heap space, and it simply doesn't need to collect so it doesn't?

Given this, would it be better to make the old gen smaller and the new gen bigger, as the rate of promotion is very small?

I'm asking, because there are indications elsewhere in the OS that we might have memory pressures, but the JVM/GC logs seems to contradict the OS.

Related to this -

We currently have min-heap=max-heap=6Gb. If top is showing a java process size of 7-8Gb, but a RSS of 5-6Gb, presumably this means that 2Gb is swapped out? In which case it's doing to die when it full GCs. So would it be better to have a smaller min-heap size that GCs more often before the OS swaps it out.

Is it generally best to leave the JVM to tune itself rather than getting obesesed with settings all the parameters manually or do most people set the params manually?

解决方案

What version of Tomcat are you using?

There's a bug in the memory leak prevention gubbins that causes full GCs on the hour:

https://issues.apache.org/bugzilla/show_bug.cgi?id=53267

(note that bug mentions its on tomcat7 but 6 is affected too, fixed in 6.0.36)

这篇关于Tomcat垃圾收集频率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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