You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2017/03/27 17:17:41 UTC

[jira] [Resolved] (CXF-6298) Memory leak in tomcat webapp

     [ https://issues.apache.org/jira/browse/CXF-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-6298.
------------------------------
       Resolution: Cannot Reproduce
    Fix Version/s: Invalid


I'm not able to reproduce the second one and the first is due to JAXB's generated accessors holding onto the classes.   There is a property to disable that I believe, but it severely impacts performance.  

> Memory leak in tomcat webapp
> ----------------------------
>
>                 Key: CXF-6298
>                 URL: https://issues.apache.org/jira/browse/CXF-6298
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 3.0.4
>         Environment: Tomcat 7.0.55
>            Reporter: Alessandro Canevese
>             Fix For: Invalid
>
>
> I'm developing a J2EE webapp with Spring 4.1, Struts2, etc.. I'm not able to redeploy my app under development more than a couple of times before a permgen / out of memory error is fired.
> To see if it's my Spring configuration fault, I've got rid of the jaxws bean and I've put the following code directly in a method:
> ...
> JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
> Client client = dcf.createClient(serviceUrl + "?wsdl");
> Object result = null;
> try
> { 
>  Object[] callResult = client.invoke(methodName, parameter);
>  result = callResult[0]; 
> }
> catch (Exception ex)
> { 
>   log.error(ex); 
> }
> ...use of result (without storing it anywhere)...
> <end of method>
> Nothing has changed. Sooner or later, when I undeploy the webapp I get a couple of the following:
> mar 12, 2015 5:46:05 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
> Grave: The web application [/soci-operativi] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@2379cbe3]) and a value of type [java.util.WeakHashMap] (value [
> {class it.cai.auth.ws.core.service.UserGroup=java.lang.ref.WeakReference@1138b647, class it.cai.auth.ws.core.service.GetUserDataResponse=java.lang.ref.WeakReference@2246f826, class java.util.ArrayList=java.lang.ref.WeakReference@614d985e, class it.cai.auth.ws.core.service.User=java.lang.ref.WeakReference@2d4e753a, class it.cai.auth.ws.core.service.Authority=java.lang.ref.WeakReference@79f24a12}
> ]) 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.
> mar 12, 2015 5:46:05 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
> Grave: The web application [/soci-operativi] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@11dd224a]) and a value of type [org.apache.cxf.BusFactory.BusHolder] (value [org.apache.cxf.BusFactory$BusHolder@4cf6316f]) 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.
> Just to be clear, classes it.cai.auth.ws.core.service.* are those dynamically created by CXF accessing the ws pointed by the serviceUrl above.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)