-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Milestone
Description
Describe the bug
When running a Quarkus application in dev-mode, at each code reload an additional copy of the application is loaded in memory, but old classloaders are not being released in full, leading to exhausting both heap memory and metaspace after some reloads.
This is the patch to GC root, the classloader which should have been removed on the top:
Class Name | Shallow Heap | Retained Heap
-----------------------------------------------------------------------------------------------------------------------------------------
io.quarkus.bootstrap.classloading.QuarkusClassLoader @ 0x41a03c490 | 128 | 314,552
'- key java.util.HashMap$Node @ 0x41bc4dc28 | 32 | 1,016
'- [6] java.util.HashMap$Node[16] @ 0x415b7c388 | 80 | 1,540,800
'- table java.util.HashMap @ 0x415b7c358 | 48 | 1,540,848
'- contextManagersForClassLoader io.smallrye.context.SmallRyeContextManagerProvider @ 0x415b7c348| 16 | 1,540,864
'- value java.util.concurrent.atomic.AtomicReference @ 0x415b7c338 | 16 | 1,540,880
'- INSTANCE class org.eclipse.microprofile.context.spi.ContextManagerProvider @ 0x415b7c2c0| 8 | 1,540,944
'- [227] java.lang.Object[5120] @ 0x41f8fba18 | 20,496 | 2,172,536
'- elementData java.util.Vector @ 0x417ce1560 | 32 | 2,172,568
'- classes io.quarkus.bootstrap.classloading.QuarkusClassLoader @ 0x417ce1368 | 128 | 9,650,128
-----------------------------------------------------------------------------------------------------------------------------------------
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
Open the hibernate-orm-quickstart from the quickstarts, run it in dev-mode and trigger live reloading N times.
Then connect a heap dump analyzer, you'll find N copies of all application classes.
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
b470a90cf3
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
No response