Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 95A309ADF for ; Fri, 2 Mar 2012 21:14:18 +0000 (UTC) Received: (qmail 41718 invoked by uid 500); 2 Mar 2012 21:14:18 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 41693 invoked by uid 500); 2 Mar 2012 21:14:18 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 41684 invoked by uid 99); 2 Mar 2012 21:14:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 21:14:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 21:14:17 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id ECA4C55F7 for ; Fri, 2 Mar 2012 21:13:56 +0000 (UTC) Date: Fri, 2 Mar 2012 21:13:56 +0000 (UTC) From: "Daniel Kulp (Resolved) (JIRA)" To: issues@cxf.apache.org Message-ID: <1910393669.14012.1330722836970.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <538041901.10093.1330008408735.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (CXF-4131) org.apache.cxf.transport.http.finalizeConfig() duplicate property listener and possible memory leak MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-4131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Kulp resolved CXF-4131. ------------------------------ Resolution: Fixed Fix Version/s: (was: NeedMoreInfo) 2.5.3 2.4.7 Assignee: Daniel Kulp > org.apache.cxf.transport.http.finalizeConfig() duplicate property listener and possible memory leak > ---------------------------------------------------------------------------------------------------- > > Key: CXF-4131 > URL: https://issues.apache.org/jira/browse/CXF-4131 > Project: CXF > Issue Type: Bug > Components: Transports > Affects Versions: 2.4.6, 2.5.2 > Reporter: Louis-Rene Poirier Beauchemin > Assignee: Daniel Kulp > Fix For: 2.4.7, 2.5.3 > > > org.apache.cxf.transport.http.finalizeConfig() calling two times client.addPropertyChangeListener(this) resulting in duplicated PropertyChangeListener entry in the HTTPClientPolicy.propertyListener field. > First instance added is here: > {noformat} Thread [main] (Suspended (breakpoint at line 859 in org.apache.cxf.transport.http.HTTPConduit)) > org.apache.cxf.transport.http.HTTPConduit.setClient(org.apache.cxf.transports.http.configuration.HTTPClientPolicy) line: 859 > org.apache.cxf.transport.http.HTTPConduit.configureConduitFromEndpointInfo(org.apache.cxf.transport.http.HTTPConduit, 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, org.apache.cxf.ws.addressing.EndpointReferenceType) line: 253 > {noformat} > The second one is here: > {noformat} > 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, org.apache.cxf.ws.addressing.EndpointReferenceType) line: 253 > {noformat} > 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() : > {noformat} > PropertyChangeListener listener = (PropertyChangeListener) selectedConduit; > List policies = > pExchange.getEndpoint().getEndpointInfo().getExtensors( > HTTPClientPolicy.class); > for (HTTPClientPolicy policy : policies) > { > long nbListener = CxfReflectionInstrospectorUtil.getListenerNb(policy, listener); > while (nbListener > 0) > { > policy.removePropertyChangeListener(listener); > --nbListener; > } > } > {noformat} > 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira