Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] EclipseLink and Memory Problems

It is very odd if a single UnitOfWorkChangeSet is consuming 227M.  How big is
the transaction you are trying to commit?

Some possible memory issues may be,
- You are using a single EntityManager for multiple transactions.  An
EntityManager (extended) or persistence context in JPA must tracking
everything read through it, so if you re-use the same EntityManager
continuously, it will just continue to get bigger and bigger.  You should
instead create a new EntityManager per transaction, or call clear() to
release its contents.  EclipseLink also provides a weak persistence context
option for EntityManagers if you really need to reuse the same one.

- Check you cache settings.  If you cache size is very large, or you have
Full caching enabled, then the cache will get very big.  Try making a
smaller cache, using a weak cache, or disabling the cache by setting
share=false.

- If you are processing very large transactions, it is normally better to
split them up into smaller batches (or say 1000 objects each).

Ensure that nothing in your application is holding onto old EntityManagers
or old objects read through old EntityManagers.

What version of EclipseLink are you using?



Florian Schaetz-2 wrote:
> 
> Hello,
> 
> I'm noticing something strange here: My application uses EclispseLink 
> and consumes a lot of memory. Most of the memory seems (according to a 
> heap dump) be consumed by EcliseLink. Somehow EclipseLink seems to 
> consume more and more memory - until it reaches the limit and starts to 
> get incredibly slow.
> 
> My latest Heap Dump shows, that the application used 835MB. One 
> UnitOfWorkChangeSet consumes 227MB and another one is there that 
> consumes 220MB. And finally there are around 440.000 instances of 
> QueryBasedValueHolder using 88MB.
> 
> I don't care about the memory itself, but the application gets very slow 
> when trying to use EclipseLink while being at the memory limit, thus 
> EclipseLink is obviously slowing itself down by consuming the memory.
> 
> Has anyone experienced this? Any solutions?
> 
> Flo
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/EclipseLink-and-Memory-Problems-tp29698110p29708663.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top