-
Bug
-
Resolution: Done
-
Major
-
7.73.0.Final
-
None
-
NEW
-
NEW
-
---
-
---
Hello, we are using DMNRuntime API with the org.kie.dmn.compiler.execmodel property set to true, here is a code snippet:
// singleton, shared between multiple threads class RuleService { // kieContainer = KieServices.Factory.get().getKieClasspathContainer() // KieRuntimeFactory.of(kieContainer.getKieBase()).get(DMNRuntime.class) private final DMNRuntime dmnRuntime; private final DMNModel dmnModel; Object evaluateRule(SomeBean input) { var context = dmnRuntime.newContext(); context.set("input", input); var result = dmnRuntime.evaluateByName(dmnModel, context, "someDecision"); return result.getDecisionResultByName("someDecision").getResult(); } }
RuleService is a singleton and the evaluateRule method is invoked frequently from different threads that handle incoming requests. We are observing that the committed heap memory rises over time and never goes down. Heap dump shows that the DMNModel instance accumulates references to StatefulKnowledgeSessions (see attached screenshots)
With org.kie.dmn.compiler.execmodel set to false this issue goes away - there are no leaks.
Looks like the root cause is that the executor instance is not disposed here: https://github.com/kiegroup/drools/blob/7.73.0.Final/kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/execmodelbased/AbstractModelEvaluator.java#L76
- is related to
-
DROOLS-7043 kie-maven-plugin:generateDMNModel is unable to compile DMN files with imports
- Closed