Administrator
|
Hi,
FYI, I think we should update Jacques From: "Phil Steitz (JIRA)" <[hidden email]> > > [ https://issues.apache.org/jira/browse/DBCP-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] > > Phil Steitz résolue DBCP-294. > ------------------------------ > > Résolution: Corrigé > > Applied the patch with the following changes/additions: > > 1) Modified BasicDataSource to allow BasicManagedDataSource to use PoolableManagedConnectionFactory > 2) Added a "full" constructor for PMCF so BasicManagedDataSource properties can be set > 3) Made initializeConnection protected in PCF and added call to this in PMCF#makeObject() > 4) Modified PoolableManagedConnection constructor to not ignore abandonedConfig parameter > 4) Added a test case demonstrating the bug > > Thanks for the patch! > >> Memory leak in XA Implementation >> -------------------------------- >> >> Clé: DBCP-294 >> URL: https://issues.apache.org/jira/browse/DBCP-294 >> Projet: Commons Dbcp >> Type de demande: Bogue >>Affecte les versions: 1.3, 1.4, 2.0 >> Environnement: JDK5, Oracle 10G,Postgres 8.x >> Rapporteur: Philippe Mouawad >> Attribution: Phil Steitz >> Priorité: Critique >> Corriger pour: 1.3 >> >> Pièces jointes: memory.png, PoolableManagedConnection.java, PoolableManagedConnectionFactory.java, Test.zip, >> TransactionRegistry-patch.txt >> >>Estimation originale: 52h >> Estimation restante: 52h >> >> Hello, >> We are been using Ofbiz with DBCP based implementation. >> Ofbiz uses a Head revision of DBCP (package org.apache.commons.dbcp.managed is the same as current TRUNK) and >> geronimo-transaction-1.0. >> We are having recurrent OutOfMemory which occur on a 2 days basis. >> I analyzed the Heap Dump and I think have found the source of the problem: >> The Heap Dump shows a Retained Heap of 400Mo by org.apache.commons.dbcp.managed.TransactionRegistry#xaResources field. >> After analyzing more deeply, the leak seems to come from what is stored in xaResources through >> xaResources.put(connection, xaResource); >> Values inside weak Hash map will never be removed since XAResource holds a STRONG reference on key (connection) through: >> org.apache.commons.dbcp.managed.LocalXAConnectionFactory$LocalXAResource through: >> public LocalXAResource(Connection localTransaction) { >> this.connection = localTransaction; >> } >> Found in WeakHashMap javadoc: >> Implementation note: The value objects in a WeakHashMap are held by ordinary strong references. >>>>>>>>>>>>>Thus care should be >> taken to ensure that value objects do not strongly refer to their own keys <<<<<<<<, either directly or indirectly, since that >> will prevent the keys from being discarded. Note that a value object may refer indirectly to its key via the WeakHashMap itself; >> that is, a value object may strongly refer to some other key object whose associated value object, in turn, strongly refers to >> the key of the first value object. One way to deal with this is to wrap values themselves within WeakReferences before inserting, >> as in: m.put(key, new WeakReference(value)), and then unwrapping upon each get. >> Philippe Mouawad >> http://www.ubik-ingenierie.com > > -- > Ce message a été généré automatiquement par JIRA. > - > You can reply to this email to add a comment to the issue online. > > |
Free forum by Nabble | Edit this page |