WebappClassLoader Leak [message #1837472] |
Sat, 30 January 2021 21:01  |
Eclipse User |
|
|
|
I'm working with a very simple Jersey REST application to access a MySQL database. My environment:
Windows 10 Professional (64 bit, latest updates)
OpenJDK 11.0.10
Apache Tomcat 7.0.107
Jersey Rest 2.33
I've included the application configuration file and a sample resource file.
The InstituteInfo class is a DAO that returns a JavaBean container with the results to be serialized to JSON.
This all works well, and various web applications can consume the information.
Unfortunately when I undeploy the web application, Tomcat reports a leak. This is confirmed by Eclipse MAT, analyzing the heap dump with the following OQL:
SELECT wcl.contextName.toString() AS contextName,
wcl.started AS started,
wcl.@retainedHeapSize AS retainedSize
FROM org.apache.catalina.loader.WebappClassLoader wcl
The result is:
contextName started retainedSize
/cplanapi false 586,720
The GC root is:
class com.sun.naming.internal.ResourceManager
'- propertiesCache java.util.WeakHashMap
'- table java.util.WeakHashMap$Entry[16]
'- [13] java.util.WeakHashMap$Entry
'- referent org.apache.catalina.loader.WebappClassLoader
This also occurs on Linux, and with JRE 8 instead of 11.
Any solutions would be much appreciated.
|
|
|
Re: WebappClassLoader Leak [message #1837496 is a reply to message #1837472] |
Mon, 01 February 2021 01:46  |
Eclipse User |
|
|
|
It turns out that this is a false flag. Doing a complete GC on the Tomcat instance removed this from the heap.
Unfortunately, hot redeploys without a GC have the potential to create an OOM MetaSpace issue before a GC is triggered. This means that I probably need to look at my MetaSpace and GC configurations.
Sorry for the noise.
|
|
|
Powered by
FUDForum. Page generated in 0.04118 seconds