JVM HeapDump:内存在"java.util.concurrent.ConcurrentHashMap $ Segment"的一个实例中累积. [英] JVM HeapDump: The memory is accumulated in one instance of "java.util.concurrent.ConcurrentHashMap$Segment

查看:578
本文介绍了JVM HeapDump:内存在"java.util.concurrent.ConcurrentHashMap $ Segment"的一个实例中累积.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用JVM堆时遇到了麻烦.

I have trouble with the JVM-Heap.

我们通过Apache HTTP Server和Apache Tomcat Application Server运营一个网站.

We operate a website with Apache HTTP Server and an Apache Tomcat Application Server.

所有对Apache HTTP Server的* .jsp请求都将重定向到Tomcat服务器(协议:ajp).

All *.jsp Requests to the Apache HTTP Server will be redirected to the Tomcat Server (protocol: ajp).

该网站有超过1万个jsp文件.

The website has more than 10'000 jsp files.

我们也有一个Google Search Appliance,它每晚都会抓取该网站.

We have also a google search appliance and it crawle the website every night.

爬网时,jvm堆空间增加到8 GB的最大限制.

While it crawling, the jvm heap space rise to the max limit of 8 GB.

使用javamelody,我可以看到堆空间增加了与已加载类的相似性.

With javamelody, I can see that the heap space increase analogue to the loaded classes.

为进行分析,我进行了堆转储.

For the analyse I took a heapdump.

这是eclipse MAT的报告:

Here is the report from eclipse MAT:

"org.apache.catalina.loader.StandardClassLoader @ 0x7092c5148"加载的"org.apache.jasper.servlet.JspServlet"实例占用1'189'603'328(96.75%)字节.

One instance of "org.apache.jasper.servlet.JspServlet" loaded by "org.apache.catalina.loader.StandardClassLoader @ 0x7092c5148" occupies 1'189'603'328 (96.75%) bytes.

内存在由"加载的"java.util.concurrent.ConcurrentHashMap $ Segment []"的一个实例中累积.

The memory is accumulated in one instance of "java.util.concurrent.ConcurrentHashMap$Segment[]" loaded by "".

关键字

java.util.concurrent.ConcurrentHashMap $ Segment []

java.util.concurrent.ConcurrentHashMap$Segment[]

org.apache.catalina.loader.StandardClassLoader @ 0x7092c5148

org.apache.catalina.loader.StandardClassLoader @ 0x7092c5148

org.apache.jasper.servlet.JspServlet

org.apache.jasper.servlet.JspServlet

GSA请求是否存在问题?

Is there a Problem with GSA request/s?

为什么JVM无法卸载生成的类?

And why can't JVM unload the generated classes?

推荐答案

加载所有JSP确实会引起问题.

It does look like loading all the JSPs is causing problems.

默认情况下,Tomcat将所有加载的JSP保留在内存中,直到Web应用程序停止为止.

By default, Tomcat keeps all loaded JSPs in memory until the web application stops.

在Tomcat 7中,可以设置JSP Servlet的maxLoadedJsps参数来限制保存在内存中的JSP的数量.

In Tomcat 7 you can set the maxLoadedJsps parameter of the JSP Servlet to limit the number of JSPs held in memory.

这篇关于JVM HeapDump:内存在"java.util.concurrent.ConcurrentHashMap $ Segment"的一个实例中累积.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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