Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible memory leak in net.sf.jasperreports.engine.xml.BaseSaxParserFactory #119

Open
whind opened this issue Feb 17, 2020 · 2 comments
Open

Comments

@whind
Copy link

whind commented Feb 17, 2020

Hi, I begin using Jasper Reports library recently.
I use version 6.11.0.
When I shutdown Tomcat(version 8.5.50), it add to log:
The web application [/Example1] created a ThreadLocal with key of type [java.lang.ThreadLocal] ... com.sun.org.apache.xerces.internal.util.xmlgrammarpoolimpl@c020514}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
This is unwanted behavior because I sometimes redeploy application.
For inspect who load this class, I used Jprofiler and saw that class xmlgrammarpoolimpl is called by: 1. javax.xml.parsers.SAXParserFactory which called by net.sf.jasperreports.engine.xml.BaseSaxParserFactory by ... by net.sf.jasperreports.engine.JasperCompileManager
2. org.apache.catalina.loader.WebappClassLoaderBase which called by net.sf.jasperreports.engine.util.JRLoader by net.sf.jasperreports.engine.xml.BaseSaxParserFactory by .. by net.sf.jasperreports.engine.JasperCompileManager

Maybe you know how to avoid this problem, or maybe you can help solve this problem?

@whind
Copy link
Author

whind commented Feb 17, 2020

INFO [Thread-11] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
INFO [Thread-11] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
INFO [Thread-11] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
INFO [localhost-startStop-2] org.apache.catalina.core.ApplicationContext.log Destroying Spring FrameworkServlet 'dispatcher'
INFO [localhost-startStop-2] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@3d1bc241]) and a value of type [org.apache.commons.collections4.map.ReferenceMap] (value [{ParallelWebappClassLoader
context: ROOT
delegate: false
----------> Parent Classloader:
java.net.URLClassLoader@2e0fa5d3
=com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl@399b0938}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

@reda-alaoui
Copy link

Introduced by 6e7e581 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants