[hibernate-dev] Memory consumption

Emmanuel Bernard emmanuel at hibernate.org
Sat May 12 06:31:56 EDT 2012


On 11 mai 2012, at 00:11, Andrej Golovnin wrote:

> After updating JBoss 7 to use the Hibernate Validator 4.3.0 and
> adding <property name="javax.persistence.validation.mode" value="NONE"/>
> to our persistence.xml file I was able to reduce memory consumption
> of SerializableValidatorFactory from ca. 90MB to ca. 256KB. :-)
> What I was not able to do, is to avoid loading of Hibernate Validator
> and Hibernate Envers at all as we don't use them.

That reminds me that when frameworks make use of Integrators (especially ServiceContributingIntegrator), they can't fully disable them. I have created https://hibernate.onjira.com/browse/HHH-7319

Also, if you do not use Hibernate Validator annotations, 90MB might indeed be too much :) Hardy, I wonder if we could optimize the memory model and JPa initialization so that we check if a class has constraints and if it does not, Hibernate Validator keeps a small placeholder to remember that but does not consume any other memory for this non validated class. We could save a lot instead of building the model and keeping it in memory.

I have created https://hibernate.onjira.com/browse/HV-589

Andrej, I wonder if you could share with us these memory dumps privately so we could also analyze them.

Emmanuel


More information about the hibernate-dev mailing list