potential memory leak persisting objects with eclipselink 2 [message #539514] |
Fri, 11 June 2010 07:33 |
Vadim Gerassimov Messages: 4 Registered: June 2010 |
Junior Member |
|
|
Hello,
maybe my problem mainly is related to glassfish (I posted it there). But ask for advise here too.
The situation is following. I have a JEE6 (using CDI) application packaged as war running on glassfish v3 (3.0.1 b21). I have a stateless bean whose business method is invoked asynchronously:
@Override
@Asynchronous
@Lockable(lockName = HARVEST_XBRL_REPORTS_LOCK_NAME)
@XbrlNextJobFireable
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void harvestData(Long jobId) {
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). Besides my objectss a lot of UnitOfWorkCacheKey are in memory. No GC doesn't help. Reference keeper of cached objects according the visualvm is some PersistenceObjectInstantiationPolicy.
PS: is it normal eclipselink behavior in transactional environment when eclipselink keeps all objects in memory until transaction completes? Is there any way to overcome such feature?
Thanks,
Vadim
[Updated on: Fri, 11 June 2010 08:43] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02812 seconds