I'm using drools-core 7.68.0.Final to serialize a KieBase using DroolsObjectOutputStream. Each time that I subsequently deserialize the KieBase back into memory using DroolsObjectInputStream I get a new/separate instance of the org.drools.core.rule.JavaDialectRuntimeData$PackageClassLoader
. This results in a severe memory leak in metaspace resulting in duplicate instances of all classes defined within the KieBase.
I've tried setting the class loader in the constructor for DroolsObjectInputStream
but that had no effect.
Any suggestions?