cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Louis-Rene Poirier Beauchemin (Created) (JIRA)" <>
Subject [jira] [Created] (CXF-4131) org.apache.cxf.transport.http.finalizeConfig() duplicate property listener and possible memory leak
Date Thu, 23 Feb 2012 14:46:48 GMT
org.apache.cxf.transport.http.finalizeConfig()  duplicate property listener and possible memory

                 Key: CXF-4131
             Project: CXF
          Issue Type: Bug
          Components: Transports
    Affects Versions: 2.5.2, 2.4.6
            Reporter: Louis-Rene Poirier Beauchemin
             Fix For: NeedMoreInfo

org.apache.cxf.transport.http.finalizeConfig() calling two times client.addPropertyChangeListener(this)
resulting in duplicated PropertyChangeListener entry in the HTTPClientPolicy.propertyListener
First instance added is here:
{noformat} Thread [main] (Suspended (breakpoint at line 859 in org.apache.cxf.transport.http.HTTPConduit))
line: 859     
org.apache.cxf.service.model.EndpointInfo) line: 334     
     org.apache.cxf.transport.http.HTTPConduit.finalizeConfig() line: 413     
     org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(org.apache.cxf.service.model.EndpointInfo, line: 253     
The second one is here:
Thread [main] (Suspended)     
     org.apache.cxf.transport.http.HTTPConduit.finalizeConfig() line: 421     
     org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(org.apache.cxf.service.model.EndpointInfo, line: 253 

This problem seem to had been introduced when we upgraded to version 2.5.2 from version 2.3.2

Because we implemented a custom ConduitSelector and reuse the Conduit instance, this generated
a memory leak from HTTPClientPolicy.propertyListener.
The work around we currently use to clean the extra instances is by reflection.
We use reflection to know how much duplicate instances there is in HTTPClientPolicy.propertyListener
because there is no public api to access the array.
We then call HTTPClientPolicy.removePropertyChangeListener(listener) multiple time with the
same instance to remove all of them as in the following snipplet from our implementation of
ConduitSelector.complete() :
 PropertyChangeListener listener = (PropertyChangeListener) selectedConduit;
                        List<HTTPClientPolicy> policies =
                        for (HTTPClientPolicy policy : policies)
                            long nbListener = CxfReflectionInstrospectorUtil.getListenerNb(policy,
                            while (nbListener > 0)

regards and many thanks for your efforts,
Louis-Rene Poirier Beauchemin.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message