-
Notifications
You must be signed in to change notification settings - Fork 41.1k
High Memory Usage After Upgrading to Spring Boot 3.4.4 #44931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@spring-projects-issues @Hardikraja Please assign this issue to me. After upgrading from Spring Boot 3.3.5 to 3.4.4, the application experiences a significant increase in memory usage, rising from 300MB to 2000MB. The key difference in this upgrade is the transition from Hibernate 6.5.3 to Hibernate 6.6.11, where the default query parser has shifted from JpaQueryParserSupport to an ANTLR-based parser. This change appears to be causing excessive memory consumption during HQL to SQL parsing, even before any queries are executed. To address this issue, I will first confirm whether the new parser is responsible for the memory spike by profiling memory usage using tools such as VisualVM or Eclipse Memory Analyzer (MAT). If the ANTLR parser is indeed the cause, I will investigate whether rolling back to Hibernate 6.5.3 while keeping Spring Boot 3.4.4 remains a viable option without causing compatibility issues. Additionally, I will explore possible optimizations in Hibernate configurations, such as query caching and parser settings, to mitigate excessive memory consumption. If necessary, I will report findings to the Hibernate and Spring Boot teams and suggest potential fixes or workarounds. I will work on debugging and resolving this issue and provide updates on the progress. |
Which vulnerability is driving a 3.3 to 3.4 upgrade?
I don't think we'd ever advise it, but if needs be then it's worth a try. Note that it hasn't been tested and we wouldn't officially support Hibernate 6.5 with Boot 3.4. That said, the upgrade from Hibernate 6.5 to 6.6 looks to have been a smooth one.
Unknown. You should test it in your application.
We're not aware of any, but the Hibernate team will be much better-placed to answer this.
I'd recommend updating that issue with a complete yet minimal sample that reproduces the problem. In particular, that sample should provide the "multiple Repositories … with enough HQL Queries to identify the difference". I'll close this one on the Spring Boot side as I don't think there's anything for us to do. /cc @mp911de for awareness on the Spring Data side of things. |
Here is the POC Project which reproduces the issue https://github.com/Hardikraja/hibernate-6.6.11-case-with-subquery |
Bug Report: High Memory Usage After Upgrading to Spring Boot 3.4.4
Problem Description
After upgrading from Spring Boot 3.3.5 to Spring Boot 3.4.4, we observed a significant increase in memory consumption in our application.
Steps to Reproduce
Set up a Spring Boot 3.3.5 Application:
Upgrade to Spring Boot 3.4.4:
pom.xml
orbuild.gradle
.Observed Behavior with our application
Expected Behavior
Memory consumption should remain within a reasonable range after upgrading to a newer version of Spring Boot and Hibernate.
Workaround Considered
Since we urgently need to upgrade due to security vulnerabilities, we are considering excluding Hibernate 6.6.11 and manually using Hibernate 6.5.3.
This issue has been reported in the Hibernate JIRA: HHH-19292 for further investigation.
The text was updated successfully, but these errors were encountered: