-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Entities stay in memory long after session is closed
PostPosted: Mon Nov 20, 2006 8:50 pm 
Newbie

Joined: Mon Nov 20, 2006 8:32 pm
Posts: 3
We are experiencing a memory leak and upon close inspection I noticed that even after the hibernate session is closed the entities read from DB stay in memory even though there is no reference to them typically over one hour.

1. We are using only session level cache (default).
2. Our sessions are short lived (we are using spring OpenSessionInViewFilter)

I also ran the same query (in a different session) and now there are twice as many as before in memory which suggests that there is no caching taking place between sessions.

Is this normal? Is there a way to force hibernate to mark these entities for GC or at least shorten the time they are kept in memory?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 21, 2006 9:59 am 
Regular
Regular

Joined: Tue Feb 24, 2004 11:42 am
Posts: 56
I suspect Hibernate is using its inbuilt ehcache-failsafe.xml.Its guess but if it worls pls do rate.So you might create a new ehcache.xml and set the time to be 0.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 21, 2006 1:58 pm 
Newbie

Joined: Tue Nov 21, 2006 1:32 pm
Posts: 2
Location: Germany
Are you sure that there are no open references to the objects from within your application?

When the session is closed, the pojos get detached.
If they don't get garbage-collected, you should at first find out, who holds references to them.
Have you checked that?
(I would prefer yourkit java profiler to check for open references).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.