*
The moose likes Object Relational Mapping and the fly likes memory leak in spring-hibernate application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "memory leak in spring-hibernate application" Watch "memory leak in spring-hibernate application" New topic
Author

memory leak in spring-hibernate application

anuja Kar
Greenhorn

Joined: Jun 15, 2010
Posts: 9
Hello
I am having a spring hibernate webapplication which runs on jboss server. I have noticed JVM Free memory decreasing drastically in a weeks time since i start the server .
and jvm thread count goes up. I have run heap dump on eclipse memory analyzer and it list -org.hibernate.impl.SessionFactoryImpl as prime suspect . My application connect to three different database and hence having three sessionFactories. I have disabled the cache still the memory analyzer shows object retained by org.hibernate.engine.query.QueryPlanCache . Is there any way to disable this ?

Following are my hibernate properties.



Thanks & Regards
Anuj
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

Try hibernate.cache.use_query_cache false

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/performance.html#performance-querycache

I feel that probability of this being a issue with Hibernate is on the lower side.

It is also possible that rather than being a memory leak the issue be caused due to large amount of data being loaded by the application. In this case the objects will show up as being referenced by Session Factory even though the application is loading the data.

Have you enabled GC logging? At times the GC logs provide useful information. Are you also taking thread dumps?

I would suggest that you look at the type of entities being held in memory in the heap dump. Then try to co-relate it with the thread dump that you have taken, i:e is any of the threads showing up in thread dump loading this data?
anuja Edathu
Ranch Hand

Joined: Sep 09, 2005
Posts: 84
Thank you for the suggestion. now im tryingto analyse the thread dump.

Regards
Anuja
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: memory leak in spring-hibernate application
 
Similar Threads
Srping+Hibernate bad configurated causing huge memory consumption
Hibernate show_sql not working
Character encoding problem while using oracle 11g and hibernate along with Spring
testâ„¢ (test with TradeMark symbol) inserting as 'test?' withHibernate and MySQL
JDBCContext returning TransactionManager as null