-
Notifications
You must be signed in to change notification settings - Fork 41.2k
JarFileWrapper may cause many FinalReferences causing GC pressure #28042
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
Thanks for the report. I have reproduced the behaviour that you have described. I suspect that the changes for #22991 are the cause. It was intended to fix a problem that's specific to Java 11 but it looks as if it may have regressed things on Java 8. Running on Java 8, the peak memory footprint of |
This may have been reported previously in #23505 but there wasn't enough information to diagnose the problem. |
@philwebb What's your take on this one? Short of having different code for Java 8 and Java 11 (which is tricky as we're sub-classing), I'm not sure what the best approach is here. |
I'm really not sure how to fix this one. We do have #26745 open as well. |
@wilkinsona would you mind checking this fix to see if it works with your sample. I think it's working when I try it both on Java 11 and 8. |
👍 LGTM. |
|
@fankaifeng As far as we know, this problem was fixed in Spring Boot 2.4.12. If you're using a newer version of Spring Boot and the problem is still occurring, please open a new issue and provide a complete yet minimal sample that reproduces it. |
Why is the problem version 2.5.4 raised by HzjNeverStop not compatible after 2.4.12, our version is 2.3.12.RELEASE, do not want to upgrade, how to solve it |
@fankaifeng it's been fixed in 2.5.6 as well, see #28356. |
@helloworldtang That is to be expected as this issue was not fixed until 2.5.6. |
Uh oh!
There was an error while loading. Please reload this page.
Environment:spring boot 2.5.4 + jdk8
Create a bean to continue load class which could not be found,than use java -jar start springboot fatjar
many org.springframework.boot.loader.jar.JarFileWrapper will be create which increase FinalReference time in gc:

when update spring boot version to 2.1.13,it's ok:

In normal it will not happen because LaunchedURLClassLoader has package cache,but it will happen when so bug trigger many nonexistent class load.
The text was updated successfully, but these errors were encountered: