-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Validator Memory Usage
PostPosted: Fri Nov 15, 2013 10:22 am 
Newbie

Joined: Fri Nov 15, 2013 10:09 am
Posts: 2
Before validation, my memory usage is 63MB. My object graph consists of approximately 200K objects.

With my scenario, Hibernate Validator 5.0.1.Final gets an OutOfMemoryError at -Xmx512m, but succeeds at -Xmx1024m.
Our more comprehensive test case has a graph of up to 10 million objects, and fails at -Xmx8g.
My validators don't contain state, and the OOM errors do not have my validators in the call stack.

Is there anything I can do to reduce Hibernate Validator memory usage? The alternative would be for me to implement my own validator implementation that finds annotated classes, runs the appropriate validators, and packages its own ConstraintViolations, but I think you'll agree that that would be a pretty bad outcome.


Top
 Profile  
 
 Post subject: Re: Validator Memory Usage
PostPosted: Fri Nov 15, 2013 10:28 am 
Newbie

Joined: Fri Nov 15, 2013 10:09 am
Posts: 2
I should note that if I remove all custom validators, I don't have a memory usage issue. This is true even if the validators all use default violation generation. To me, this implies that Hibernate Validation is doing something inappropriate and different with custom validators that it doesn't do with stock validators.


Top
 Profile  
 
 Post subject: Re: Validator Memory Usage
PostPosted: Fri Nov 15, 2013 1:06 pm 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

That's interesting and I agree that this doesn't look right. Its hard to say whats the reason is without having some more details though.

Could you create an issue with our JIRA tracker (https://hibernate.atlassian.net/browse/HV), attaching a test case which shows the issue? Or if you could pass a heap dump that'd help as well. Have you tried using a tool such as Eclipse MAT (http://www.eclipse.org/mat/) to analyze the heap structure when an OOME occurs?

Thanks,

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.