<div><br></div> Dan,<div><br></div><div> I am not aware of any memory leak in CR1. If you can provide me with a test case I will investigate this today. Please open a JIRA, attach your test case and let me know. If there is a leak, I need to fix it before final release.</div>
<div><br></div><div> And it is not a problem to instantiate objects in a rule's consequence. That is "business as usual". <br><br></div><div> Thanks,</div><div> Edson</div><div><br><div class="gmail_quote">
2010/7/28 dmiller44 <span dir="ltr"><<a href="mailto:dmiller@versatile.com">dmiller@versatile.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hello,<br>
<br>
I have a weird issue, and I'm trying to figure out if this is a bug I should<br>
report, or an error in my rule. I'm running an application with a heap<br>
space (min: 512mb, max: 1024mb) that gets full and eventually overflows<br>
relatively quickly (12hrs or less). We insert about 112 records into a<br>
Stateful Drools Session (Drools 5.1 CR1 released 7/22/2010) every 30seconds,<br>
using CLOUD session type, single thread, with fireUntilHalt.<br>
<br>
Our rules evaluate the object (A) we give it, and in some cases instantiate<br>
a new object (B) and insert it into the session. After processing object<br>
(A), we retract it from the session.<br>
<br>
Another rule matches on object (B), and when finished, also retracts the<br>
object.<br>
<br>
When I do a heap snapshot, I've noticed quite a few Drools-related classes,<br>
along with unreleased instantiations of object(A) & object(B) (more of the<br>
latter). Obviously I have to take into consideration that objects are being<br>
inserted at the time of the snapshot, but over a couple hours I'll have<br>
1000's of these objects. I've found the only fix to be to release the<br>
session.<br>
<br>
I should note - calling session.getObjects() shows an empty list (size 0).<br>
<br>
Is this a bug? When retract is called, shouldn't it free up the FactHandle &<br>
Object to be collected? And is instantiating an object in a rule incorrect<br>
for some reason?<br>
<br>
Below is a small chart of classes - the number of instances - and space<br>
taken. (TemperatureEvent represents object (A), while AssetShallowRemote<br>
represents object (B)) Any input would be appreciated.<br>
<br>
Dan<br>
<br>
<br>
| Class | Instances |<br>
Size | |<br>
|--------------------------------------------------------------+-----------+----------+---|<br>
| java.lang.String | 1155258 |<br>
41589288 | |<br>
| char[] | 1153540 |<br>
91560120 | |<br>
| java.util.concurrent.LinkedBlockingQueue$Node | 329989 |<br>
10559648 | |<br>
| java.util.LinkedHashMap$Entry | 153489 |<br>
9209340 | |<br>
| java.util.HashMap$Entry | 151929 |<br>
6684876 | |<br>
| java.sql.Timestamp | 117017 |<br>
4212612 | |<br>
| org.drools.reteoo.LeftTuple | 53395 |<br>
8756780 | |<br>
| org.drools.common.AgendaItem | 53390 |<br>
5819510 | |<br>
| org.drools.retoo.RightTuple | 53386 |<br>
5125056 | |<br>
| my.test.package.AssetShallowRemote | 42995 | 11780630 | |<br>
| org.drools.common.DefaultFactHandle | 37273 |<br>
3280024 | |<br>
| org.drools.core.util.ObjectHashSet$ObjectEntry | 37273 |<br>
1341828 | |<br>
| org.drools.common.PropagationContextImpl | 32721 |<br>
2683512 | |<br>
| org.drools.core.util.ObjectHashMap$ObjectEntry | 32721 |<br>
1639924 | |<br>
| my.test.package.TemperatureEvent | 7165 |<br>
917120 | |<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Objects-not-released-from-heap-tp1002541p1002541.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Objects-not-released-from-heap-tp1002541p1002541.html</a><br>
Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>