openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "michael.couck" <>
Subject RE: Memory leak
Date Wed, 25 Aug 2010 10:24:59 GMT

Hi Kevin,

Of course I understand, I have attached screen shots of two snapshots of the memory. The events
are building up slowly you can see, although they are being inserted at a rate of 100 per
second, only one or two per second sticks around. I can send you the heap dumps from CodePro
if you wish (you can get a trial to have a look at the dumps if necessary), but they are 30
meg each, if you have a server somewhere I can load them up to that would be easier.

Here is the configuration:

<?xml version="1.0" encoding="UTF-8"?>



    <bean id="jpaAdapter"
        class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" />

    <bean id="transactionManager"
        property:entityManagerFactory-ref="entityManagerFactoryJpa" />

    <bean id="entityManagerFactoryJpa"
            property:jpaPropertyMap-ref="jpaPropertyMap" />
    <util:map id="jpaPropertyMap">
        <entry key="openjpa.TransactionMode" value="managed" />
        <entry key="openjpa.ConnectionFactoryMode" value="managed" />
        <entry key="openjpa.ManagedRuntime" value="invocation("

        <entry key="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true,PrettyPrintLineLength=150"
        <entry key="openjpa.Log" value="DefaultLevel=INFO,SQL=INFO,File=openjpa.log,Runtime=INFO,Tool=INFO"

        <entry key="openjpa.DataCache" value="false" />
        <entry key="openjpa.QueryCache" value="false" />
        <!--<entry key="openjpa.QueryCache" value="${jpa.cache}" />
        <entry key="openjpa.DataCacheManager" value="${jpa.cache}" />-->

        <entry key="openjpa.LockTimeout" value="6000000" />
        <entry key="openjpa.ReadLockLevel" value="read" />
        <entry key="openjpa.WriteLockLevel" value="write" />
        <entry key="openjpa.Optimistic" value="false" />
        <entry key="openjpa.Multithreaded" value="true" />
        <entry key="openjpa.NontransactionalRead" value="false" />
        <entry key="openjpa.AutoDetach" value="commit" />
        <entry key="openjpa.FlushBeforeQueries" value="false" />
        <entry key="openjpa.RuntimeUnenhancedClasses" value="supported" />

        <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
        <entry key="openjpa.Connection2UserName" value="${jdbc.user}" />
        <entry key="openjpa.Connection2Password" value="${jdbc.password}" />
        <entry key="openjpa.Connection2URL" value="${jdbc.url}" />
        <entry key="openjpa.Connection2DriverName" value="${jdbc.driver}" />


C3po datasource, DB2. With Hibernate there is at most 10 events on the heap at any time, I
tested to 5 000 000 events, so I am pretty sure.

Not to worry, no one else is likely to hit this problem. I find the most unusual things and
hit every bug in everything, found a memory leak in an Oracle driver once, sent them a mail
asking what to do, they said upgrade. We had a contract for support with them as well for
€50 000 per year. Go figure.


Date: Tue, 24 Aug 2010 07:10:16 -0700
Subject: Re: Memory leak

Hi Michael,

No, we are not aware of any memory leaks.  We do extensive testing looking

for memory leaks.  Especially before cutting a new release (or point

release).  What version of OpenJPA are you running with?  If you are running

with a nightly from trunk, then I suppose there could be a memory leak that

we haven't discovered yet.

I think we would need more "proof" of the memory leak before anybody would

dive into this exercise.  Can you provide more data that would pinpoint the

source of the leak?  The description below is just a little too high level.

Thanks for your help,


On Tue, Aug 24, 2010 at 3:07 AM, michael.couck <[hidden email]>wrote:


> Hello,


> I am an avid fan of OpenJpa, been using it for years, no problems at all,

> good work! Nice error messages, had a look at the code too, also good and

> the documentation has no drivel, just to the point. However I have to

> mention that I have found a memory leak, reproducable of course.


> Environment:

> I am using no caching. Windows, Java 1.6, Spring, Bitronix, OpenJpa,

> BirtonixPoolingDataSource, DB2. I am inserting several million records in a

> table, at about 100 per second, but every second one of the objects that

> get

> inserted doesn't get collected, the real object, in this case it is an

> Event, and the enhanced object something like xxx*xxx*xxx*Event.


> I saw the leak and it is immediately apparent where it is, but I didn't

> believe it, so I tried for days to find the meak in my own code. Couldn't

> because the objects are allocated on the stack, so once the method exists

> they get collected. So I reluctently switched to Hibernate, took about an

> hour to do the changes. And the meak disappeared completely, so I can only

> conclude that the leak is in OpenJpa.


> I profiled with VisualVM and CodePro, with the same results. I could switch

> back to OpenJpa (have the configuration already of course) and profile

> again

> and save the snapshots, in both OpenJpa and Hibernate for comparison if

> necessary.


> Anyone else seen this?


> Regards,

> Michael

> --

> View this message in context:

> Sent from the OpenJPA Developers mailing list archive at


View message @

To unsubscribe from Memory leak, click here.

View this message in context:
Sent from the OpenJPA Developers mailing list archive at

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