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.  [ 10 posts ] 
Author Message
 Post subject: Hibernate Core 3.2.3 : Big memory leak
PostPosted: Thu Apr 12, 2007 11:22 am 
Newbie

Joined: Wed Mar 28, 2007 1:19 pm
Posts: 7
Hi,

I used to have major memory leaks when using hibernate 3.2.2. This problem was identified in jira bug tracking tool and fixed in version 3.2.3.

I've included this brand new version in my application but i still have the memory leak problem.

Does anybody have this problem in the last release ? Maybe this bug isn't fixed at all ???

Thanks for your help.

Regards.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 5:06 am 
Newbie

Joined: Wed Mar 28, 2007 1:19 pm
Posts: 7
I really need help on this topic ... does anybody knows about this problem ?


Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 10:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Out of memory can happen for alot of reasons - you don't explain how you get yours nor what jira issue you think it is.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 11:04 am 
Newbie

Joined: Wed Mar 28, 2007 1:19 pm
Posts: 7
Hi,

The JIRA issue is : HHH-2481 ("Big memory leak in the use of CGLIB")

Here is the link : http://opensource.atlassian.com/projects/hibernate/browse/HHH-2481

My J2EE context : I'm running a webapp under JBoss AS 4.0.2 with hibernate 3.2.3 and cglib 3.2.1.

My problem: When I deploy/undeploy the webapp about 3 times the following message occurs in JBoss console : "Perm Gen OutOfMemoryError " and then the whole Application Server is freezed.

I've profiled my webapp with Jprofiler and JConsole. What i can tell is that when I deploy and use the webapp the Perm Gen stack grows but is never garbage collected. I repeat the deployement/use/undeployement process for about 3 times and the perm gen stack still grows till it overflows.

There's a strange thing that I've noticed with JProfiler : when I undeploy this webapp I still got few hibernate classes references that are not cleared. And the next deployement comes with its own hibernates classes references. I looks like some Hibernate classes are link with JBoss ThreadLocal and are not garbage collected till JBoss dies.

So the issue HHH-2481 seems to describe my problem and was supposed to be fixed in the release 3.2.3.

Do you have an idea ?

Thanks a lot for your help.

Best Regards.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 11:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
where are those references from ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 11:49 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Quote:
My problem: When I deploy/undeploy the webapp about 3 times the following message occurs in JBoss console : "Perm Gen OutOfMemoryError " and then the whole Application Server is freezed.


Everybody gets that, hot re-deploy is broken everywhere. This is not a Hibernate issue.

If I increase the PermGen size of my JBoss AS I can deploy a few hundred times without restarting:

http://docs.jboss.com/seam/1.2.1.GA/ref ... ml#d0e2171

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 11:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
christian - It was made much worse in hibernate so it is an issue we can help reduce as we did with the mentioned jira issue.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 11:57 am 
Newbie

Joined: Wed Mar 28, 2007 1:19 pm
Posts: 7
Ok for increasing the perm gen stack size.

But that is very estonishing. Moreover our application server handles about 20 applications. It implies that memory leaks will add themsleves so as it will overflows the stack very quickly.

Does anyone have another idea ? or the only solution is increasing the perm gen stack size ?

Thranks.

Regards.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 12:18 pm 
Beginner
Beginner

Joined: Wed May 23, 2007 1:07 pm
Posts: 28
twittemb wrote:
Ok for increasing the perm gen stack size.

But that is very estonishing. Moreover our application server handles about 20 applications. It implies that memory leaks will add themsleves so as it will overflows the stack very quickly.

Does anyone have another idea ? or the only solution is increasing the perm gen stack size ?

Thranks.

Regards.


I would also like to know what the solution for this problem is...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 5:51 pm 
Regular
Regular

Joined: Sun Sep 30, 2007 7:51 pm
Posts: 93
I'm not sure, but if hibernate uses the String.intern() for all (or most) strings loaded from db, than increasing the perm size is the only one solution, or removing the intern calls. This also means, if your data entries are very various strings, the perm heap will grow and grow.

Well, I'm not 100% sure the intern is the cause, maybe someone from hibernate can tell how intern is used.

In our previous persistent layer (before switching to hibernate) we have made interns only for strings smaller than some size.

Regards,
Pavol


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 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.