Hi,
I am fronting my rule engine by a stateless session façade bean, running in a weblogic container. The rule bases are loaded only once via a singleton.
I was running a profiler over the app and have noticed a lot of rule engine objects still attached to the tree. My stub which invokes the working memory looks like the following:
try {
handle = wm.assertObject(shift);
wm.assertObject(shiftCalculator);
wm.fireAllRules();
} catch (RuntimeDroolsException e) {
throw new TimesheetServiceUnavailableException(
"Could not add shift to Working Memory", e);
}
wm.clearAgenda();
wm.dispose();
LoggingUtils.logMethodFinish(logger, methodName);
As you can see if an exception occurs then the dispose method is not run. Could this lead to memory leakage?
I have subsequently modified the offending stub to include a finally block
finally {
wm.clearAgenda();
wm.dispose();
LoggingUtils.logMethodFinish(logger, methodName);
}
Matt Shaw
Snr Applications Developer
Service Performance & Management Unit
Phone: 3247 8666. ext. 94666