Chronicle-Core icon indicating copy to clipboard operation
Chronicle-Core copied to clipboard

ClassLocal prevents Chronicle from unloading from classloader

Open alamar opened this issue 4 years ago • 2 comments

If a mapping of Java lang type -> Chronicle object is put to ClassLocal retained in a static field, such as java.lang.Integer -> SerializationStrategies#ANY_SCALAR, then Chronicle classes may not be unloaded from ClassLoader and ClassLoader will never be reclaimed by GC.

See https://bugs.openjdk.java.net/browse/JDK-8136353

alamar avatar Nov 24 '21 13:11 alamar

ClassLocal is a Chronicle class so while it is used for anything, it will prevent core from being unloaded.

peter-lawrey avatar Feb 25 '22 14:02 peter-lawrey

The user may expect that our libraries may unload when no longer needed, when in fact this won't happen.

alamar avatar Feb 28 '22 14:02 alamar

Was it fixed @yevgenp ?

alamar avatar Jan 18 '24 10:01 alamar

@alamar Peter's comment implies it's by design.

yevgenp avatar Jan 18 '24 10:01 yevgenp