JVM HeapDump: The memory is accumulated in one instance of "java.util.concurrent.ConcurrentHashMap$Segment

醉酒当歌 提交于 2019-12-23 02:17:01

问题


I have trouble with the JVM-Heap.

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

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

The website has more than 10'000 jsp files.

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

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

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

For the analyse I took a heapdump.

Here is the report from eclipse MAT:


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

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

Keywords

java.util.concurrent.ConcurrentHashMap$Segment[]

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

org.apache.jasper.servlet.JspServlet


Is there a Problem with GSA request/s?

And why can't JVM unload the generated classes?


回答1:


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

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

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



来源:https://stackoverflow.com/questions/10436573/jvm-heapdump-the-memory-is-accumulated-in-one-instance-of-java-util-concurrent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!