Hibernate version: Hibernate Core 3.3.1 / Hibernate Search 3.1.0
Hi.
I'm facing a huge memory usage problem, so, I'm asking help on how to reduce the runtime memory taken by Hibernate.
We have a web application which, on the previous version, with 63 tables, was taking initially 62M on tomcat.
The new version has 142 tables (139 entities), and initially, it takes 145M with the same tomcat.
Those numbers are suggesting a direct relationship between the persistent classes and the memory used.
I've spent days profiling and monitoring, and I've taken heap snapshots using Java VisualVM, and it tells me, for example, that there are 7645 (!?!) live instances of org.hibernate.loader.entity.EntityLoader, which takes 1.3M.
Not much compared to the total 145M, but the most space is used by char[] (in Strings), and I've randomly inspected them, and most are entity meta-data, like column aliases, property names, select clauses and so on...
We had production servers with 25 instances of the application with 2G of memory, but, if we don't reduce it's usage, we'll have infrastructure problems...
Does anyone has a clue on how to reduce that memory usage?
|