openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: Is there a memory leak with org.apache.openjpa.kernel.FinalizingBrokerImpl
Date Mon, 02 Jun 2014 22:52:06 GMT
The scary part of the proposed patch is what impact this will have on the
"more important" non-finalizing BrokerImpl...  That is, if these two
assignments would get reversed now to correct this supposed memory leak
with FinalizingBrokerImpl, what impact would this have on non-finalizing
BrokerImpls?

        if
(FinalizingBrokerImpl.class.isAssignableFrom(bv.getTemplateBrokerType(_conf)))
{
            return MapBackedSet.decorate(new ConcurrentHashMap(), new
Object() { });
        } else {
            return new
ConcurrentReferenceHashSet<Broker>(ConcurrentReferenceHashSet.WEAK);
        }

I mean "more important" since in most cases we want the container to manage
the lifecycle and, thus, avoid the overhead associated with the
FinalizingBrokerImpl...



On Mon, Jun 2, 2014 at 1:26 PM, Chathuri Wimalasena <kamalasini@gmail.com>
wrote:

> I'm closing all the EntityManagers in a finally block. I will check if I
> miss any place.
>
>
> On Mon, Jun 2, 2014 at 2:17 PM, Rick Curtis <curtisr7@gmail.com> wrote:
>
> > > Any idea why I might get this issue and any suggestions to avoid this ?
> > Please make sure that your application closes all EntityManagers when
> > you're through with them.
> >
> > Thanks,
> > Rick
> >
> >
> > On Mon, Jun 2, 2014 at 12:20 PM, Chathuri Wimalasena <
> kamalasini@gmail.com
> > >
> > wrote:
> >
> > > Hi Devs,
> > >
> > > We are using apache openJPA 2.2 version and we experience some memory
> > leak
> > > issues. While analyzing the memory dump, I see
> > > *org.apache.openjpa.kernel.FinalizingBrokerImpl
> > > *as one suspect for the memory leak.
> > >
> > > 311,437 instances of
> *"org.apache.openjpa.kernel.FinalizingBrokerImpl"*,
> > > loaded by *"sun.misc.Launcher$AppClassLoader @ 0x117a09088"* occupy
> > > *585,849,792
> > > (55.60%)* bytes. These instances are referenced from one instance of
> > > *"java.util.concurrent.ConcurrentHashMap$Segment[]"*, loaded by
> *"<system
> > > class loader>"*
> > >
> > > *Keywords*
> > > java.util.concurrent.ConcurrentHashMap$Segment[]
> > > sun.misc.Launcher$AppClassLoader @ 0x117a09088
> > > org.apache.openjpa.kernel.FinalizingBrokerImpl
> > >
> > > While searching, I found [1] which is still open. Does this patch
> applied
> > > in openJPA 2.2 version ? Any idea why I might get this issue and any
> > > suggestions to avoid this ?
> > >
> > > Thanks..
> > > Chathuri
> > >
> > > [1] https://issues.apache.org/jira/browse/OPENJPA-1193
> > >
> >
> >
> >
> > --
> > *Rick Curtis*
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message