Mitch Christensen
Mitch Christensen

Reputation: 1

Classloader Leak while Deserializing KieBase

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?

Upvotes: 0

Views: 188

Answers (1)

Mitch Christensen
Mitch Christensen

Reputation: 1

We just recently were able to resolve the leak. It turned out not to be in Drools after all, but rather there was a cache layer that was serializing and deserializing the KieBase using standard input and output streams. Eliminating this caching layer and deserializing exclusively via DroolsObjectInputStream fixed the class loader leak.

Thanks for replying.

Upvotes: 0

Related Questions