-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Upgrade from 3.3.5 to 3.4.1: SpringBootTests throw OutOfMemoryError #34279
Comments
That looks odd to me as the cache has a default size of 32. Did you increase the size (using |
No, we neither increased the cache size nor created our own. |
Thanks for the feedback, @Christian-Harnisch-DB. Though without a means to observe the behavior you're describing, it will be very difficult for us to determine the cause. In light of that, please provide us a minimal sample application (or all-in-one test class) that reproduces the issue, preferably something that we can download and run ourselves (such as public Git repository or a ZIP file attached to this issue). Thanks in advance! |
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 delay, I'm sort of confused by this memory leak. I uploaded a demo project in the attached ZIP file. This is freshly generated using Spring Initializr, I only added that In our actual code, we don't need that many test runs. I think this is because the demo contains no additional code, so it's just standard Spring beans occupying memory. I'm not sure, though. |
stop()
andshutdown()
methods)@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD)
and@TestInstance(PER_METHOD)
java.lang.OutOfMemoryError: Java heap space
)org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext
are referenced fromorg.springframework.beans.factory.support.DefaultListableBeanFactory
. It appears that this is about one instance per SpringBootTest.[Weak/Soft Reachable]
, whereas in 3.4.1 it doesn't (are they strong references now?)Example stacktrace:
Environment:
Attempted solutions:
server.shutdown
toimmediate
The text was updated successfully, but these errors were encountered: