[jira] Commented: (GERONIMO-3326) ClassLoader memory leak caused by OpenJPA
[ https://issues.apache.org/jira/browse/GERONIMO-3326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517455 ] Kevan Miller commented on GERONIMO-3326: Committed to branches/2.0. Waiting for OpenJPA snapshot to be available, before merging to trunk. > ClassLoader memory leak caused by OpenJPA > - > > Key: GERONIMO-3326 > URL: https://issues.apache.org/jira/browse/GERONIMO-3326 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues) > Components: persistence >Affects Versions: 2.0-M7 >Reporter: Kevan Miller >Assignee: Kevan Miller >Priority: Blocker > Fix For: 2.0 > > Attachments: OpenJPAMemLeak-G.patch, OpenJPAMemLeak-OJPA.patch > > > As David Jencks mentioned in GERONIMO-3305, there's a ClassLoader memory leak > in deploy/undeploy. > Geronimo is running out of PermGen space in some simple deploy/undeploy > scenarios involving OpenJPA. The cause of the problem seems to be the _metas > table in PCRegistry. _metas is a ConcurrentReferenceHashMap with WEAK > reference keys and HARD reference values. The keys are the PersistenceCapable > classes. While the values are the metadata for these classes which are > maintained by the internal Meta class. > The cause of the ClassLoader memory leak is simple -- if any of the > objects/classes held by the Meta class (e.g. fieldTypes) have also been > loaded by the same ClassLoader used to load the PersistenceCapable class, the > PersistenceCapable class (the weak key) will never be GCed. The value of the > HashMap entry will always maintain a hard reference to the ClassLoader. Since > the ClassLoader will never be GC'ed, the the the pcClass Class object will > never be GC'able... > The problem can be easily recreated using current Geronimo trunk and the > Geronimo Daytrader application. > FYI, here are the GC Roots for one of our ClassLoaders being leaked -- > http://people.apache.org/~kevan/PCRegistryLeak.html > I've contacted the OpenJPA dev list. Hopefully, can get this resolved, > quickly. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (GERONIMO-3326) ClassLoader memory leak caused by OpenJPA
[ https://issues.apache.org/jira/browse/GERONIMO-3326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517138 ] Donald Woods commented on GERONIMO-3326: The OpenJPA part of this was committed tonight by Kevin Sutter - r561970 | kwsutter | 2007-08-01 17:55:44 -0400 (Wed, 01 Aug 2007) | 1 line OPENJPA-285. I am going ahead with the integration of Kevan's patches for the t wo memory leaks found in OpenJPA while testing Geronimo. I will post more detai ls in the Issue. Are we ready to commit the Geronimo changes? > ClassLoader memory leak caused by OpenJPA > - > > Key: GERONIMO-3326 > URL: https://issues.apache.org/jira/browse/GERONIMO-3326 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues) > Components: persistence >Affects Versions: 2.0-M7 >Reporter: Kevan Miller >Assignee: Kevan Miller >Priority: Blocker > Fix For: 2.0 > > Attachments: OpenJPAMemLeak-G.patch, OpenJPAMemLeak-OJPA.patch > > > As David Jencks mentioned in GERONIMO-3305, there's a ClassLoader memory leak > in deploy/undeploy. > Geronimo is running out of PermGen space in some simple deploy/undeploy > scenarios involving OpenJPA. The cause of the problem seems to be the _metas > table in PCRegistry. _metas is a ConcurrentReferenceHashMap with WEAK > reference keys and HARD reference values. The keys are the PersistenceCapable > classes. While the values are the metadata for these classes which are > maintained by the internal Meta class. > The cause of the ClassLoader memory leak is simple -- if any of the > objects/classes held by the Meta class (e.g. fieldTypes) have also been > loaded by the same ClassLoader used to load the PersistenceCapable class, the > PersistenceCapable class (the weak key) will never be GCed. The value of the > HashMap entry will always maintain a hard reference to the ClassLoader. Since > the ClassLoader will never be GC'ed, the the the pcClass Class object will > never be GC'able... > The problem can be easily recreated using current Geronimo trunk and the > Geronimo Daytrader application. > FYI, here are the GC Roots for one of our ClassLoaders being leaked -- > http://people.apache.org/~kevan/PCRegistryLeak.html > I've contacted the OpenJPA dev list. Hopefully, can get this resolved, > quickly. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
