-->
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.  [ 1 post ] 
Author Message
 Post subject: Memory Leak in ISQLQuery ExecuteUpdate()
PostPosted: Mon Oct 06, 2008 1:07 pm 
Newbie

Joined: Mon Oct 06, 2008 12:41 pm
Posts: 1
Hibernate version: 2.0.1.4000

Code:
using (ISession sess = factory.OpenSession())
{
string sql = "update mytable set count = 0 where id=0";
ISQLQuery qry = sess.CreateSQLQuery(sql);
qry.ExecuteUpdate();
qry = null;
}

Hi,
every time i run the code above in a Windows Forms Application (.Net 2)
the GC will not collect these (recorded with YourKit Profiler):

Type Count Size in Bytes

Code:
 System.String   48      940
 System.Collections.Generic.Dictionary/KeyCollection<System.String,System.Object>   2      24
 System.Collections.Generic.Dictionary<System.String,System.Object>   2      104
 Iesi.Collections.Generic.HashedSet<System.String>   2      24
 NHibernate.Engine.Query.Sql.NativeSQLQuerySpecification   1      24
 NHibernate.SqlCommand.SqlString   1      16
 NHibernate.Util.SequencedHashMap/Entry   1      24
 NHibernate.Engine.Query.Sql.INativeSQLQueryReturn[]   1      16
 NHibernate.Engine.Query.NativeSQLQueryPlan   1      16
 NHibernate.Loader.Custom.Sql.SQLCustomQuery   1      24
 System.Collections.Hashtable/bucket[]   1      144
 System.Collections.ArrayList   1      24
 System.Collections.Hashtable   1      56


For example, in the first line, you see that, every time, there are 48 strings with a total size of 940 bytes not garbage collected.
And other types are also not freed.

Could you confirm this error?


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

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.