Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6458

CXF 3.1.0 memory leak (Tomcat)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1
    • None
    • Core
    • None
    • Unknown

    Description

      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.
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              neilw1 neil walker
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: