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