users@glassfish.java.net

Glassfish v 3 (3.0.1 b21 win xp) potential memory leak persisting objects

From: <glassfish_at_javadesktop.org>
Date: Fri, 11 Jun 2010 00:34:45 PDT

Hello,

maybe my issue is mainly related to eclipselink, but ask for help or advice here too.

The situation is following. I have a JEE6 (using CDI) application packaged as war. I have a stateless bean whose business method is invoked asynchronously:

[i]@Override
        @Asynchronous
        @Lockable(lockName = HARVEST_XBRL_REPORTS_LOCK_NAME)
        @XbrlNextJobFireable
        @TransactionAttribute(TransactionAttributeType.REQUIRED)
        public void harvestData(Long jobId) {[/i]

The method loads a lot of data via webservice and persists it to database (Oracle 10.2.05). I noticed that the server eats too many memory and even doesn't free after job execution. I annotated domain objects @Cacheable(false) - without any success. I set eclipselink.cache.size.default to 0 eclipselink.cache.type.default to Weak in persistence.xml - no effect. My application proceeds data by chunks (100 elements) and persists it, after persisting I do flush and even EntityManagerFactory.getCache().evictAll(). I thought that it would help - no success. Only setting eclipselink.cache.type.default to NONE I had some effect. The memory was freed after job execution (not after flushing and evicting the cache). Maybe this is the feature of the transaction - during the transaction no cached object are freed (am I right?).

If I use eclipselink.cache.type.default with other than NONE value, after application undeploy cached objects are still in memory (I discovered it using visualvm). No GC doesn't help. Reference keeper of cached objects according the visualvm is some PersistenceObjectInstantiationPolicy.

Am I doing smth wrong whether it is a bug in gf 3.0.1 b21 or in eclipslink (2.0.1.v20100213-r6600)?

Tahnks,
Vadim
[Message sent by forum member 'vadger']

http://forums.java.net/jive/thread.jspa?messageID=473855