OpenHFT / Java-Runtime-Compiler

Java Runtime Compiler
Other
645 stars 144 forks source link

Class unloading issue #136

Open kimec opened 5 months ago

kimec commented 5 months ago

Even though the compiler is using WeakHashMap, class unloading does not work due to the circular dependency between the key - class loader and the value - the class.

PR #135 addresses the issue by wrapping the class with WeakReference. I have also added a test that triggers class unloading to prove wrapping the class was enough to make the GC reclaim it.