-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernat objects (not application objects) stuck in memory?
PostPosted: Wed Jun 10, 2009 6:16 pm 
Newbie

Joined: Wed Jun 10, 2009 5:52 pm
Posts: 1
Hi,

We have an application that uses Hibernate as JPA impl sometimes using specific Hibernate features such as sessions. We've noticed that even after the user sessions are closed some Hibernate objects remain in memory what ends up causing huge CG processes that virtually kill the app performance after some time.

No appl objects are kept in memory, mainly Hibernate objects such as:

Class Instances bytes
MapAccessor$MapSetter 160.728 3.857.472
Dom4jAccessor$ElemetGetter 160.728 6.429.120
Dom4jAccessor$ElemetSetter 160.728 5.143.296
.
.
. [many others]

Any clues here? Why are those objects never killed? How can we get rid of them?

Any help would be greatly appreciated.

Tks,
Joe


Top
 Profile  
 
 Post subject: Re: Hibernat objects (not application objects) stuck in memory?
PostPosted: Wed Jun 10, 2009 7:05 pm 
Newbie

Joined: Thu Jun 04, 2009 9:40 am
Posts: 3
Hi,

here is an image of what he's talking about:

Image

any help?

tks!


Top
 Profile  
 
 Post subject: Re: Hibernat objects (not application objects) stuck in memory?
PostPosted: Tue Jun 16, 2009 8:47 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
about which versions of Hibernate and JBoss are we talking about?

I profile recent versions of Hibernate quite often and didn't see such a behaviour; also you're probably posting on the wrong forum, or do you experience this behaviour only when using some hibernate extension?

How do you know the object are not going to be collected soon? the default JBoss configuration is to change the garbage collection to once an hour, so unless it needs memory it will keep many unused references around for some time; this is generally a good thing on application servers, you can change the option in JBOSS_HOME/bin/run.conf.
Ideally you should create a testcase to profile your code to verify this numbers outside of the container.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernat objects (not application objects) stuck in memory?
PostPosted: Fri Jun 19, 2009 3:59 pm 
Newbie

Joined: Thu Jun 04, 2009 9:40 am
Posts: 3
Hi Sanne,

We found the solution to this problem, and the root cause. There was a request scoped backing bean in the app that was creating too many EntityManagerFactories, and these EntityManagerFactories were creating these objects.
We know about CG times in JBoss, and for a test purpose we set it up to 3 min. All the objects were being collected, but these ones weren't.
After controlling the EMF creation, we could reduce objects in memory.
Just to know: we don't create an unique EMF for the entire application because the users that log in to the application have a DB user associated, and each user need a EMF for their interaction on the application, with specific user/password for the DB. This is not a problem, since we store the EMF in the user session, closing it at the session timeout (using a session listener).
The problem was a default EMF, used to validade user's login/passowrd, created by an business object.

Well, thank's for posting anyway!


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