[
https://issues.apache.org/jira/browse/CXF-6458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14592449#comment-14592449
]
Mattias Jiderhamn commented on CXF-6458:
----------------------------------------
This seems to be a [known limitation of the JAXB
API|https://java.net/jira/browse/JAXB-1000]. Issue claims you can avoid the
problem by explicitly closing the Unmarshaller, but I haven't tried that myself.
> CXF 3.1.0 memory leak (Tomcat)
> ------------------------------
>
> Key: CXF-6458
> URL: https://issues.apache.org/jira/browse/CXF-6458
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: neil walker
>
> I have created a CXF project using wsdl2java, make no changes (i.e. blank
> project) I deploy it to Tomcat 7 or 8. As soon as I click 'stop', without
> even calling it, I am getting SEVERE errors from Tomcat regarding memory
> leaks and inability to close threads. Every time I start/stop I get an
> additional WebappClassLoader (I have done a memory dump and checked using
> Eclipse MAT) for the webapp and it only gets fixed when I restart tomcat.
> Tomcat also reports this using the 'test for leaks' button.
> This originally happened on CXF2.7 so I upgraded to 3, I have also tried the
> very latest JAXB reference implementation.
> The stack trace is as follows:
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(Automati
> cWorkQueueImpl.java:353)
> java.lang.Thread.run(Thread.java:722)
> 11-Jun-2015 15:45:33.142 SEVERE [http-nio-8080-exec-2]
> org.apache.catalina.loade
> r.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application
> [MyAcces
> sAPSServiceN] created a ThreadLocal with key of type
> [com.sun.xml.bind.v2.ClassF
> actory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@27765bfc]) and a value
> of t
> ype [java.util.WeakHashMap] (value [{class
> org.apache.cxf.ws.addressing.Attribut
> edURIType=java.lang.ref.WeakReference@4b9111a1}]) but failed to remove it
> when t
> he web application was stopped. Threads are going to be renewed over time to
> try
> and avoid a probable memory leak.
> 11-Jun-2015 15:45:33.143 SEVERE [http-nio-8080-exec-2]
> org.apache.catalina.loade
> r.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application
> [MyAcces
> sAPSServiceN] created a ThreadLocal with key of type
> [com.sun.xml.bind.v2.ClassF
> actory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@27765bfc]) and a value
> of t
> ype [java.util.WeakHashMap] (value [{class
> org.apache.cxf.ws.discovery.wsdl.Hell
> oType=java.lang.ref.WeakReference@211c87c9, class
> javax.xml.ws.wsaddressing.W3CE
> ndpointReference$Address=java.lang.ref.WeakReference@5816ae1a, class
> javax.xml.w
> s.wsaddressing.W3CEndpointReference=java.lang.ref.WeakReference@39005a24,
> class
> org.apache.cxf.ws.discovery.wsdl.ScopesType=java.lang.ref.WeakReference@461e0eb8
> , class java.util.ArrayList=java.lang.ref.WeakReference@5f5875fe, class
> javax.xm
> l.ws.wsaddressing.W3CEndpointReference$Elements=java.lang.ref.WeakReference@28aa
> a799}]) but failed to remove it when the web application was stopped. Threads
> ar
> e going to be renewed over time to try and avoid a probable memory leak.
> 11-Jun-2015 15:45:33.146 SEVERE [http-nio-8080-exec-2]
> org.apache.catalina.loade
> r.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application
> [MyAcces
> sAPSServiceN] created a ThreadLocal with key of type
> [com.sun.xml.bind.v2.ClassF
> actory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@27765bfc]) and a value
> of t
> ype [java.util.WeakHashMap] (value [{class
> org.apache.cxf.ws.addressing.Attribut
> edURIType=java.lang.ref.WeakReference@5be142aa}]) but failed to remove it
> when t
> he web application was stopped. Threads are going to be renewed over time to
> try
> and avoid a probable memory leak.
> 11-Jun-2015 15:45:33.148 SEVERE [http-nio-8080-exec-2]
> org.apache.catalina.loade
> r.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application
> [MyAcces
> sAPSServiceN] created a ThreadLocal with key of type
> [com.sun.xml.bind.v2.ClassF
> actory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@27765bfc]) and a value
> of t
> ype [java.util.WeakHashMap] (value [{class
> javax.xml.ws.wsaddressing.W3CEndpoint
> Reference$Address=java.lang.ref.WeakReference@21dfd606, class
> javax.xml.ws.wsadd
> ressing.W3CEndpointReference=java.lang.ref.WeakReference@6e5c3549, class
> org.apa
> che.cxf.ws.discovery.wsdl.ScopesType=java.lang.ref.WeakReference@67ae8439,
> class
> java.util.ArrayList=java.lang.ref.WeakReference@726aef5c, class
> org.apache.cxf.
> ws.discovery.wsdl.ByeType=java.lang.ref.WeakReference@4a88bbb3, class
> javax.xml.
> ws.wsaddressing.W3CEndpointReference$Elements=java.lang.ref.WeakReference@56db0a
> ff}]) 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 message was sent by Atlassian JIRA
(v6.3.4#6332)