• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Hibernate - Out of Memory Issues

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All, we have a leak in our application, and was hoping someone could get me pointed in the right direction to resolve. We go through about 3gb of memory, in about 3 weeks (100 users).

The Memory Dump Diagnostic for Java tool, suggest that the likely suspect is a HashTable in the JTASessionContext. We are using CMT, so no specific transaction logic in our data access.

MDDJ specifies:
LEAK_ROOT as org.hibernate.impl.SessionFactoryObjectFactory
LEAK_CONTAINER as java.util.HashTable$Entry[]

Any suggestions on where to look?
Thanks,
Kevin..
 
Kevin Myers
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just thought of something....hopefully someone can confirm?

While we are using CMT & getCurrentSession, I also have to set the commitment level (isolation level) to NONE....This is because none of the tables on the backend db are journaled, so commit control is not possible. Unfortunately, journaling is not a possiblity at this time either.

Could this be causing the session to remain open?
Looking at the backend db (as400), I appears that the tables accessed remain open after each request.

If this is the problem....is there a workaround..

Thanks,
Kevin..
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most probably. If you never commis and Hibernate never flushes the session the contents of the session will just increase. Not a memory leak as such, more misuse of Hibernate.

I'm not sure why database journalling should require you don't use transactions. Can you explain?
 
Kevin Myers
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response Paul, yeah I guess leak was the wrong word to use...I figured it was misuse on our part, just not sure where. New to Hibernate.

Anyway, the db journalling (for as400 db2) provides the ability to rollback (among other things), and without that there is no transactions....Because the tables are not journaled, any attempt to update them, without the isolation level set to NONE, is rejected by DB2.

So is it possible that even though we are using getCurrentSession, that the session is not being closed after the DAO method ends?

Kevin..
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah - so does as400 db2 implement it rollback segement via journalling? I'm more used to here the term used in conjunction with audit trails - hence my confusion.

Hibernate will hook into the commit issued by CMT and flush the session accordingly. But if there is no "T" I'm not sure what it will do. You might try swapping to explicitly controlling your session management, i.e. abandeon the session per business transaction pattern and open/close sessions yourself.
 
Kevin Myers
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul, I'll give that a shot and see what happens.

Kevin..
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Paul

Hibernate 4.3 has new implementation for JTASessionContext.

Have you used it?

Please refer to HHH 1786

Regards,

Seetesh
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic