openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "michael.couck" <michaelco...@hotmail.com>
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"?>

<beans
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:property="http://www.springframework.org/schema/p"
    xmlns:util="http://www.springframework.org/schema/util"

    xsi:schemaLocation="
            http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd">

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

    <bean id="transactionManager"
        class="org.springframework.orm.jpa.JpaTransactionManager"
        property:entityManagerFactory-ref="entityManagerFactoryJpa" />

    <bean id="entityManagerFactoryJpa"
            class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
            property:persistenceXmlLocation="${persistence-jpa-openjpa.xml}"
            property:dataSource-ref="searchDataSource"
            property:jpaVendorAdapter-ref="jpaAdapter"
            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(TransactionManagerMethod=bitronix.tm.TransactionManagerServices.getTransactionManager)"
/>

        <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}" />
    </util:map>

</beans>

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.

Cheers,
Michael




Date: Tue, 24 Aug 2010 07:10:16 -0700
From: ml-node+5457029-19047376-287055@n2.nabble.com
To: michaelcouck@hotmail.com
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,

Kevin


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:

> http://openjpa.208410.n2.nabble.com/Memory-leak-tp5455918p5455918.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.

>







View message @ http://openjpa.208410.n2.nabble.com/Memory-leak-tp5455918p5457029.html


To unsubscribe from Memory leak, click here.


 		 	   		  
 
 
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Memory-leak-tp5455918p5460615.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

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