Discussion:
Is this a classloader leak?
Suvendu Sekhar Mondal
2018-09-20 16:25:23 UTC
Permalink
Hello Everyone,

Recently I am investigating a Metaspace leak issue. I dumped Metaspace
content over time using jcmd. While comparing them I can see that
there are 15,000 classes which are taking 120MB in that area! For all
of them InstCount(number of object instances of the Java class) is
zero. That tells me there is *no object* for those 15K classes in
heap. I can see that too in heap. No objects found for those classes.

Then why are they still live in the Metaspace and not getting cleared
by Full GC? Definitely they have some reference(s) from somewhere. All
I can see that they were loaded by 'class loader 0x0000000021005760a
'org/apache/catalina/loader/WebappClassLoader'. Is this another form
of classloader leak or something else? Any idea?

Environment:
Windows 2012 server, JDK 1.8_92, Tomcat 7.0.55

Thanks!
Suvendu

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Mark Thomas
2018-09-20 17:38:04 UTC
Permalink
Post by Suvendu Sekhar Mondal
Hello Everyone,
Recently I am investigating a Metaspace leak issue. I dumped Metaspace
content over time using jcmd. While comparing them I can see that
there are 15,000 classes which are taking 120MB in that area! For all
of them InstCount(number of object instances of the Java class) is
zero. That tells me there is *no object* for those 15K classes in
heap. I can see that too in heap. No objects found for those classes.
Then why are they still live in the Metaspace and not getting cleared
by Full GC? Definitely they have some reference(s) from somewhere. All
I can see that they were loaded by 'class loader 0x0000000021005760a
'org/apache/catalina/loader/WebappClassLoader'. Is this another form
of classloader leak or something else? Any idea?
Use a profiler, trace the GC roots and figure out why the references are
being retained.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org

Loading...