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.  [ 5 posts ] 
Author Message
 Post subject: high memory usage/consumption
PostPosted: Tue Sep 16, 2008 12:04 pm 
Newbie

Joined: Thu Mar 02, 2006 12:11 pm
Posts: 3
NHibernate version: 1.0.1.0

Name and version of the database you are using: Oracle 10 G

WebConfig:

Code:
<nhibernate>      
      <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
      <add key="hibernate.dialect" value="NHibernate.Dialect.Oracle9Dialect"/>
      <add key="hibernate.connection.driver_class" value="NHibernate.Driver.OracleDataClientDriver"/>
      <add key="hibernate.use_reflection_optimizer" value="false"/>
    <add key="hibernate.cache.use_second_level_cache" value="false"/>
</nhibernate>



Hi guys.

Recently a started to develop a WebService in IIS 5, and used NHibernate.
This WebService it's called several times a second. That is a big problem for me because de memory usage grow up a lot. It reaches 2 GB of memory afters some hours.
I stored a static reference for SessionFactory, so that I can Open a new Session every time I need.
When the WebMethod is invoked I build a new Session like this:

Code:
ISession sessao = factory.OpenSession();


After all loading (with session.CreateCriteria) and data saving I close the session like this:
Code:
sessao.Close();
sessao = null;


and I have no further loading and saving after this and the WebMethod returns.

Every time my WebMethod its called the memory usage increases

I have searched over the forum, but I still don't have a solution to my problem.

I already tried to use the Evit() method like this:
Code:
GlobalThings.Sessionfactory.Evict(typeof(Navio));
GlobalThings.Sessionfactory.Evict(typeof(ExtEquipamento));
GlobalThings.Sessionfactory.Evict(typeof(ExtInstituicao));


Those are the objects that I load and save to the DB.

I think that the SessionFactory is not cleaning some objects.

I also tried to close the SessionFactory to clean memory, but that also doesn't work. It keeps growing (memory usage).

Can you please help me? Am I missing something? If you need the code between sessionFactory.openSession() and session.close() I can post it.

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 17, 2008 2:01 am 
Regular
Regular

Joined: Tue Jul 29, 2008 3:30 am
Posts: 74
There was a similar thread some days ago which then was continued in the Google group:
http://forum.hibernate.org/viewtopic.php?t=990445
http://groups.google.com.ar/group/nhuse ... 095fea9d39

And you should really update your NHibernate in my opinion. The current version is 2.0.0.GA


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 5:37 am 
Newbie

Joined: Thu Mar 02, 2006 12:11 pm
Posts: 3
Well, I have updated the NHibernate version, after lot's of work I'm using the most recent version 2.0.0.GA.

But the bad news is that nothing changed :(

I followed the links provided by Cremor, and I also tried the trick used by Bruno Matos here http://groups.google.com.ar/group/nhusers/browse_thread/thread/227b8f095fea9d39

It also didn't worked for me.
What else can I do? I have the source code of this version, if someone can point me some changes to solve my problem, I really appreciate it.

One more thing, I'm using session.CreateCriteria() to load my objects.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 8:09 am 
Newbie

Joined: Thu Apr 26, 2007 4:07 am
Posts: 7
Location: Ukraine
Update to IIS 7

_________________
Stanislaw Tristan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 11:47 am 
Newbie

Joined: Thu Mar 02, 2006 12:11 pm
Posts: 3
I'm afraid that upgrading to IIS 7 is not an option. It's only available to Windows Vista (SP1) and Windows Server 2008. And moving to one of those OS is out of question.

Besides, i truly believe that this behavior is related only to NHibernate.

Any more options?

Thanks to all.


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