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



This correspondence is for the named persons only. 
It may contain confidential or privileged information or both. 
No confidentiality or privilege is waived or lost by any mis transmission. 
If you receive this correspondence in error please delete it from your system 
immediately and notify the sender. 
You must not disclose, copy or relay on any part of this correspondence, if you 
are not the intended recipient. 
Any opinions expressed in this message are those of the individual sender 
except where the sender expressly, 
and with the authority, states them to be the opinions of the Department of 
Emergency Services, Queensland.
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to