|WebappClassLoader Leak [message #1837472]
||Sun, 31 January 2021 02:01
| Mark Eggers
Registered: January 2021
I'm working with a very simple Jersey REST application to access a MySQL database. My environment:|
Windows 10 Professional (64 bit, latest updates)
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:
'- propertiesCache java.util.WeakHashMap
'- table java.util.WeakHashMap$Entry
'-  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.
Powered by FUDForum
. Page generated in 0.02126 seconds