[ 
https://issues.apache.org/jira/browse/CXF-6632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14949043#comment-14949043
 ] 

Giovanni Borelli commented on CXF-6632:
---------------------------------------

Sorry, I am new to this and I don't have an actual test case to provide to you 
right now.

I am mantaining a legacy web application and this is the evidence I can provide:

StackTrace that generates memory leak:
org.apache.cxf.jaxws.spi.ProviderImpl line 101
org.apache.cxf.jaxws.ServiceImpl line 158
org.apache.cxf.wsdl11.WSDLManagerImpl line 267

Here is a snapshot of the leak (goes on until OutOfMemory): 
https://drive.google.com/file/d/0B5LMTi_mp6SeUm93MDlPajQ0YmM/view?usp=sharing

Changing line 267 in WSDLManagerImpl to:
{code}
           definitionsMap.put(new String(url), def);
{code}

eliminates the leak issue.

Another point of intervention could be changing line 145 in 
org.apache.cxf.jaxws.ServiceImpl (and any other similar statements) in an 
EndpointImpl kind of way.

> Memory leak due to literal keys in WSDLDefinition map
> -----------------------------------------------------
>
>                 Key: CXF-6632
>                 URL: https://issues.apache.org/jira/browse/CXF-6632
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.7.17
>            Reporter: Giovanni Borelli
>            Assignee: Bharath Ganesh
>
> Looks like the definitionsMap in WSDLManagerImpl holds the WSDLDefinitions 
> against a weak key, again relying
> on the WeakHashMap semantics for removal.
> The loadDefinition(String) method loads the WSDLDef and puts this in a map
> against a String key even if it was passed as a URL through 
> getDefinition(URL). 
> Like the https://issues.apache.org/jira/browse/CXF-1639 this causes a memory 
> leak.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to