Hello
we upgraded from 7.3.0.Final to 7.59.0.Final.
Now we get OutOfMemory exception in Heap space because of endless creation of RuleTerminalNodeLeftTuple objects that belong to a single rule.
I was reading the release notes but found no clue.
Please can you point me to a possible cause?
This was not happenning in 7.3.0.Final.
Is there a safer version between 7.3 and 7.59?
We are afraid what else could happen in our other ~3000 rules.
WORKAROUND:
It is unsettling that there is a workaround.
(rule and stacktrace is provided below)
When we rewrite the condition
$ac : AssetCard(_parent == $as, groupCode2 in ("A", "B", "C")) @watch(groupCode2)
NOT to use the IN operator but to use ||
$ac : AssetCard(_parent == $as, groupCode2 == "A" || groupCode2 == "B" || groupCode2 == "C") @watch(groupCode2)
it works normally.
CONTEXT:
We upgraded from 7.3.0.Final to 7.59.0.Final in hope to get rid of memory leaks.
With 7.3.0.Final we had problems with KieContainer holding references to Kie sessions, even after sessions were disposed. This (or similar issue) was fixed in 7.2, but still occured.
DETAILS:
It happens after AssetCard object is removed and a new one is inserted (+ parent and child objects are updated/deleted/inserted).
After that, the memory is filled up very fast with millions of RuleTerminalNodeLeftTuple.
The rule
rule "XXX"
agenda-group "Calculation"
salience 999999999
no-loop
when
$bc : VarBusinessCase()
$vdt : LocalDateTimeVariable(name == V.validityDateTime, value != null) @watch(value)
$ovt : LocalDateTimeVariable(name == V.offerValidityTo) @watch(value)
$as : Asset(_parent == $bc)
$ac : AssetCard(_parent == $as, groupCode2 in ("A", "B", "C")) @watch(groupCode2)
then
modify($ovt){setValue($vdt.getValue().plusDays(30))}
end
There is circular @watch(value) and modify($ovt).setValue, but there is also no-loop.
Stack trace
getStagedType:357, TupleSetsImpl (org.drools.core.common)
addInsert:85, TupleSetsImpl (org.drools.core.common)
insertChildLeftTuple:482, PhreakJoinNode (org.drools.core.phreak)
doRightInserts:160, PhreakJoinNode (org.drools.core.phreak)
doNode:67, PhreakJoinNode (org.drools.core.phreak)
switchOnDoBetaNode:569, RuleNetworkEvaluator (org.drools.core.phreak)
evalBetaNode:555, RuleNetworkEvaluator (org.drools.core.phreak)
evalNode:382, RuleNetworkEvaluator (org.drools.core.phreak)
innerEval:342, RuleNetworkEvaluator (org.drools.core.phreak)
outerEval:178, RuleNetworkEvaluator (org.drools.core.phreak)
evaluateNetwork:136, RuleNetworkEvaluator (org.drools.core.phreak)
evaluateNetwork:73, RuleExecutor (org.drools.core.phreak)
evaluateEagerList:681, DefaultAgenda (org.drools.core.common)
fireLoop:863, DefaultAgenda (org.drools.core.common)
internalFireAllRules:816, DefaultAgenda (org.drools.core.common)
fireAllRules:808, DefaultAgenda (org.drools.core.common)
internalFireAllRules:1343, StatefulKnowledgeSessionImpl (org.drools.core.impl)
fireAllRules:1334, StatefulKnowledgeSessionImpl (org.drools.core.impl)
fireAllRules:1322, StatefulKnowledgeSessionImpl (org.drools.core.impl)
Thank you in advance,
Kind regards,
Peter