quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

System resource issue when executing QuarkusUnitTests in a extension #31691

Closed HerrDerb closed 1 year ago

HerrDerb commented 1 year ago

Describe the bug

Disclaimer: I am definitly not an expert in this area, so forgive me if I use wrong words or misinterpret something 🥲 After adding some tests to my quarkus extension, I suddently had a reproducable out of memory exception, I fixed it by giving more memory for running tests, which from my view should not be necessary. I do use devservices and it seems to be an issue with those. With VisualVm connected, I found that more and more classes are getting loaded with each test, while nearly none are unloaded. Also the the utilized heap keeps growing with each test.

Maybe there is a bad clean up after a static initialized QuarkusUnitTests was executed?

Expected behavior

Java should be able to release system resources after a test has executed.

Actual behavior

More system resources are needed with each test. image

How to Reproduce?

Reproducer: https://github.com/HerrDerb/quarkus-extension-test-memory

  1. Start VisualVm
  2. Execute ./gradlew :deplyoment:test
  3. Connect VisualVm to gradle worker
  4. Watch

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

geoand commented 1 year ago

Thanks for reporting.

I'll try and have a look soon.

geoand commented 1 year ago

I could not reproduce the problem. I saw memory from both heap and metaspaces being reclaimed properly

HerrDerb commented 1 year ago

Probably an issue with my local config then. I'll close this issue for now. Sorry. Thank you anyway.

geoand commented 1 year ago

💪🏼