Thread:
 Memory Leak? 
 rchristy   14 Mar 2004, 23:12 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: rchristy (14 Mar 2004, 23:12) Replies: 0, Views: 42056
Subject: Memory Leak?
Hello, 

I've posted this under the newbie formum and haven't gotten any 
replies, so I thought I would try here.

We just started using Hibernate 2.1.2 with JBoss 3.2.3RC1 and seem to 
be having a memory leak (also using Oracle 9.2). We have a client 
application that reads about 2000 objects (the object is read-only 
mapping) one at a time from the server. If I put this client 
application into a loop that runs every 30 seconds, we run out of heap 
memory within the server after a couple of hours (we have it max VM 
size at 1.5G, and the object isn't that large). We have tried both 
net.sf.hibernate.cache.TreeCacheProvider and ehcache with the same 
results. 

We have session bean that basically performs the following steps: 

1) Creates a Session. 
2) Performs the query. 
3) Closes the Session. 

We are assuming the JBoss container is controllering the transaction 
(but this is a reading operation of a read-only bean). Are we required 
to do anything other than openning/closing a Hibernate session within 
the JBoss container? We have to be missing something to have a memory 
leak this bad. 

We are using the Hibernate Service MBean as the documentation states, 
here is the declaration within our jboss-service.xml file. 

<mbean code="net.sf.hibernate.jmx.HibernateService" 
name="jboss.jca:service=Hibernate-ScorDS"> 
<depends>jboss.jca:service=RARDeployer</depends> 
<depends>jboss.jca:service=LocalTxCM,name=jdbc/ScorDS</depends> 

<attribute 
name="CacheProvider">net.sf.hibernate.cache.TreeCacheProvider</attribut
e> 

<!-- 
<attribute 
name="CacheProvider">net.sf.ehcache.hibernate.Provider</attribute> 
--> 

<attribute name="UseQueryCache">true</attribute> 
<attribute name="MapResources"> 
&referenceservice-resources;, 
&securitiesservice-resources; 
</attribute> 
<attribute name="JndiName">java:/hibernate/ScorDS</attribute> 
<attribute name="Datasource">java:/jdbc/ScorDS</attribute> 
<attribute 
name="Dialect">net.sf.hibernate.dialect.Oracle9Dialect</attribute> 
<attribute name="UseOuterJoin">true</attribute> 
<attribute name="ShowSql">false</attribute> 
<attribute name="UserTransactionName">UserTransaction</attribute> 
<attribute 
name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionF
actory</attribute> 
<attribute 
name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JB
ossTransactionManagerLookup</attribute> 
</mbean> 


Any help would be appreciated. Thanks in advance, 

Rich
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]