[
https://issues.jboss.org/browse/DROOLS-498?page=com.atlassian.jira.plugin...
]
Davide Sottara commented on DROOLS-498:
---------------------------------------
There are two unrelated reports here
@Vitaly: I tried to reproduce the issue with the snippets you provided, but everything
seems to work fine.
It may have already been fixed by another commit, could you try again? If you still
experience the leak, we'd need to see a full reproducer.
In particular, do you have other rules in your rule base? That may make a difference!
@Kent: The problem you have reported is unrelated and more closely related to DROOLS-516.
It strictly depends on how events are processed,
while this ticket is not CEP-related.
In your case, the "leak" is not even strictly a leak, but a queue that has not
**yet** been flushed. The queue would be flushed either when the rule
becomes active again, OR, when the size of the queue exceeds a threshold (which is not
your case).
At the moment the threshold (1000) can't be changed, but if you want/need, you can
force the flush manually with this snippet, after firing the rules:
{code}
((DefaultAgenda)ksession.getAgenda()).getGarbageCollector().forceGcUnlinkedRules();
{code}
If even a few entries in the queue cause any problem, please feel free to make a case for
that
(Thanks Mario for the advice)
Davide
Memory leak in stateful session after retracting facts
------------------------------------------------------
Key: DROOLS-498
URL:
https://issues.jboss.org/browse/DROOLS-498
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 6.0.1.Final
Reporter: Vitaly Lomov
Assignee: Mario Fusco
Priority: Critical
Attachments: gcRoot.png, memory-leak2.zip, screenshot1.png
After adding many simple facts into the stateful session and then removing them, the
factHandles for the removed facts are still referenced by the session. Eventually getting
"java.lang.OutOfMemoryError: GC overhead limit exceeded" with the stack trace
(sometimes) similar to DROOLS-411.
Someone on StackOverflow suggested iterating through whatever factHandles remain after
deletion and delete those, but I get no factHandles (correct, since I removed all facts).
See screenshot for objects in memory _after_ deleting all facts.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)