Hibernate release 5.2.2 causes high CPU usage initializing metamodel and parsing queries
Description
Attachments
- 27 Sep 2016, 07:35 PM
- 23 Sep 2016, 07:51 PM
Activity

Robin Anil September 27, 2016 at 7:39 PM
I have the entire trace exported as html in the attached archive. Most of the stuff points to building HQL graph and lot of Java class loader and reflection stuff. I suspect a lot of these can be optimized.
I am not sure how to create a repro as this seem to be data dependent and our schema/java code is proprietary. I will have jump through a lot of hoops to get it public, not sure if I will be able to do that within any reasonable turn-around time for debugging.

Former user September 27, 2016 at 6:22 PM
@Robin Anil, could you add an attachment similar to the one you attached, except with PersisterFactoryImpl#createEntityPersister
and SessionFactoryImpl#checkNamedQueries
expanded as many levels as necessary to see which methods are responsible for the increase?
It would also be very helpful to see the same thing for a previous version that does not have the regression.
What would be most helpful would be a test case that reproduces this, or the result of `git bisect` that identifies the commit that causes the change.

Robin Anil September 27, 2016 at 4:23 PM
Unfortunately our code now does not work with 5.0 version, some other issue (I forget what I had to change when I migrated to 5.1 and 5.2)

Former user September 27, 2016 at 5:07 AM
@Robin Anil, could you give 5.0.11 a try as well, to see if that version has the same issue?

Robin Anil September 24, 2016 at 6:30 PM
One more data point, the CPU pegging is not there in 5.2.0 but present in 5.2.1
The CPU pegs at 100% and loading the binary takes about 10-30s. For our tests this adds up. See attached profiling screenshot showing about 2:30 minutes of measure time.
This is a regression and did not happen on version 5.1.0 and 5.2.0 But happens on 5.1.1, 5.1.2, 5.2.1, 5.2.2