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
Encoutering memory issues post Spring boot 2.7.1 version #32071
Comments
Thanks for the report, @loveshjain. There are some similarities with #32042 and #31853. Are you using |
@loveshjain I've pushed a fix for #31853 that removes the nested jars list. Once build 713 could you please try the latest SNAPSHOT and see if the memory issues persist? |
Hi @philwebb - I work with @loveshjain and am looking at this. Our problem is that we haven't been able to replicate this in non-prod. I'm going to see what I can do in that regard in the next couple of days. I'm speculating that this might have to do with the JarFile objects being removed by the GC (as they are soft referenced?) if there is memory pressure, and then being reloaded later, but never getting removed from the nested jars list? I've never really looked at custom class loader code though so I'm a bit in the dark. It was fairly odd behaviour in production - it went for several days without us noticing an issue, and when we did hit the issue it wasn't in a high-load period and it seemed to self-correct. In the tenured gen picture above it looks like it started to have a GC issue about 10am, but we didn't notice until it started affecting response time badly at about 9:45pm. We have had similar issues on multiple services though and rolling back to 2.7.0 resolved it. |
I believe we're using the JarLauncher - we're just using the spring-boot-maven-plugin and we're not overriding the 'layout'. |
See #31853 (comment). We're going to revert #29356 |
Right, thanks - I'm fairly sure that will solve our issue. I'll still try to put some effort in to replicating the problem though hopefully it'll mostly just be for the intellectual exercise now. |
@beggsj42 upgrading to |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Sorry for the late reply. I still haven't been able to replicate the problem in 2.7.1 in non-prod, but 2.7.3 definitely has solved the issue for us in production. We're happy for this issue to be closed, thanks. |
Thanks for following up. |
Apologies for commenting on a closed ticket but we are seeing similar issues upgrading from 2.4 to 2.7.16. May I know if there was any fix provided for this and it is present in the latest 2.7.x versions |
Please see above. A change was made in Spring Boot 2.7.3 that fixed the problem that was reported in this issue. That fix has not be removed and should be present in the latest 2.7.x versions. |
Hi @sm0217 Were you able to fix the issues? we are also facing similar issues when upgraded to 2.7.16. |
After upgrading our applications to Spring boot 2.7.1 version, we have started encountering memory issues.
Our Observations
Changes were made in 2.7.1 in the
org.springframework.boot.loader.jar
package around closing jar files. A list of nested jars were added and that is what is holding on to objects in our heap dump.We can see 22,000 JarFile objects in the heap dump where we'd expect about 118 as that is how many nested jars there are in the application. Note that apart from the expected jar files, the other 22,000-odd are all url = jar:file:/deployments/application-web-1.0.0.jar!/BOOT-INF/lib/swagger-ui-4.11.1.jar!/
Please find below the heap dump and Dynatrace screenshot as reference
Note :- No changes were made in org.springframework.boot.loader.jar package in 2.7.2 so I suspect the problem will still be there.
Can someone please look into this.
The text was updated successfully, but these errors were encountered: