15-20% Increase in CPU Usage after hibernate upgrade to 5.4.2

Description

We upgraded hibernate version from 4.3.5 to 5.4.2 in our java enterprise web application. There were no other changes made in the application. On executing a load test for one of the features we observed a 15%-20% increase in the cpu usage. We profiled the two application deployments (before and after) twice using jvisualvm and generated flame graphs (using sjk tool) for both the versions. Once the profiling was done for 5 mins and the next run was done for 30 mins. Kindly find the profiling snapshots and the flame graphs attached. Note the flame graphs take ~ 20 mins to open in browser.

Please troubleshoot this further and let us know what could be the root cause

Attachments

7
  • 25 Jul 2019, 07:18 AM
  • 25 Jul 2019, 07:18 AM
  • 25 Jul 2019, 07:16 AM
  • 25 Jul 2019, 07:16 AM
  • 25 Jul 2019, 07:16 AM
  • 25 Jul 2019, 07:09 AM
  • 25 Jul 2019, 07:09 AM

Activity

Show:

Sanne Grinovero August 8, 2019 at 9:48 AM
Edited

Great to know! Thanks for bringing closure; my guess is that it’s DATAJPA-1347 that helped.

 

AmitS August 8, 2019 at 8:51 AM
Edited

@Sanne Grinovero - Just yesterday we executed a few performance runs with the latest spring libraries (spring boot - 2.1.6) and luckily the cpu usage reduced after the upgrade.

We can close this issue on this note. Thanks for the analysis.

Sanne Grinovero August 7, 2019 at 6:35 PM

Almost forgot, but there was an issue which could be related:

Could you try setting the system property hibernate.bytecode.enforce_legacy_proxy_classnames=true ?

 

N.B. this has to be a system property, it can not be set as an Hibernate configuration property. Also, it should no longer be needed if you have a Spring updated enough to include https://jira.spring.io/browse/DATAJPA-1347

 

Sanne Grinovero August 7, 2019 at 2:05 PM

hi , did you have any luck with a Spring fix? Did you try Hibernate ORM 5.4.4.Final?

 

Our latest includes a whole series of performance improvements, and there’s even more if you feel like testing latest builds from master, although I don’t expect it would fix the problem with loadClass.

 

I finally have some time, I’ll review those files you provided as well.

 

Sanne Grinovero July 30, 2019 at 12:22 PM

The EntityManager and Session implementations have been merged into a single implementation since 5.2.0

 

Cannot Reproduce

Details

Assignee

Reporter

Labels

Worked in

Components

Affects versions

Priority

Created July 25, 2019 at 7:18 AM
Updated August 8, 2019 at 9:49 AM
Resolved August 8, 2019 at 9:49 AM