<html><body bgcolor="#FFFFFF"><div>Does the amount of heap allocated affect it? &nbsp;I'm wondering if there's a hidden OutOfMemoryError happening. (Which, if you're catching Throwable anywhere, is a possibility. &nbsp;Use the HeapDumpOnOutOfMemoryError VM flag to diagnose this.) And this should be easy to reproduce in your unit tests: &nbsp;just insert many unrelated objects into working memory during the test. &nbsp;In fact you could construct tests thst show the same code succeeding without the excess objects then failing with them. &nbsp;That would be essential if you think this is a core drools problem and want it fixed.<br><br>GreG</div><div><br>On Jul 6, 2010, at 10:28 AM, "Axelrod, Nelson" &lt;<a href="mailto:naxelrod@jcvi.org">naxelrod@jcvi.org</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>

<div class="WordSection1">

<p class="MsoNormal">Hi,<o:p></o:p></p>

<p class="MsoNormal">We’re having some troubling problems that can be best
explained by the following two rules. &nbsp;Based on the facts inserted into
the stateful knowledge session, we expected both rules to fire for an Hmm Hit
to TIGR00549, but only the “Test” rule fires.&nbsp; Can anyone explain
how this could possibly occur?&nbsp; There are no other rules added to the
knowledge base.&nbsp; This was tested using Drools 5.0 on Windows XP and Linux
environments.<o:p></o:p></p>

<p class="MsoNormal">&nbsp;<o:p></o:p></p>

<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#960000">rule</span></b><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">"HMM Hit"</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="apple-converted-space">&nbsp;</span></span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">when</span></b><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hit : HmmHit( aboveTrustedHit ==<span class="apple-converted-space">&nbsp;</span></span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">true</span></b><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:black">)</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
p&nbsp;&nbsp;&nbsp;&nbsp; : FeatureProperty( id == hit.hitId )</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
f&nbsp;&nbsp;&nbsp;&nbsp; : Feature ( featureId == hit.queryId, properties<span class="apple-converted-space">&nbsp;</span></span><b><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:#960000">not</span></b><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span></span><b><span style="font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:#960000">contains</span></b><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:black">p )</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="apple-converted-space">&nbsp;</span></span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">then</span></b><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="apple-converted-space">&nbsp;</span></span><b><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:#960000">if</span></b><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:black">(hit.getHitId().equals(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">"TIGR00549"</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">)) {</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.err.println(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:green">"HMM Hit rule: "</span><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:black">+ hit.getHitId() +<span class="apple-converted-space">&nbsp;</span></span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">" "</span><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:black">+ hit.getQueryId());</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#960000">end</span></b><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;</span><o:p></o:p></p>

<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#960000">rule</span></b><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">"Test"</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="apple-converted-space">&nbsp;</span></span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">when</span></b><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hit : HmmHit( aboveTrustedHit ==<span class="apple-converted-space">&nbsp;</span></span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">true</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">, hitId ==<span class="apple-converted-space">&nbsp;</span></span><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:green">"TIGR00549"</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">)</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
p&nbsp;&nbsp;&nbsp;&nbsp; : FeatureProperty( id == hit.hitId )</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
f&nbsp;&nbsp;&nbsp;&nbsp; : Feature ( featureId == hit.queryId, properties<span class="apple-converted-space">&nbsp;</span></span><b><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:#960000">not</span></b><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span></span><b><span style="font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:#960000">contains</span></b><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:black">p )</span><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="apple-converted-space">&nbsp;</span></span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">then</span></b><o:p></o:p></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.err.println(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:green">"Test rule: "</span><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">+ hit.getHitId()
+<span class="apple-converted-space">&nbsp;</span></span><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:green">" "</span><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">&nbsp;</span></span><span style="font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:black">+ hit.getQueryId());</span><o:p></o:p></p>

<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#960000">end</span></b><o:p></o:p></p>

<p class="MsoNormal">&nbsp;<o:p></o:p></p>

<p class="MsoNormal">Notably, this error is dependent on the amount and/or order
of facts loaded into the knowledge session although we’re talking &lt;
20k facts total.&nbsp; We have repeatedly found problems when running
system-level tests of our production rules that do not appear when we run our
unit tests, with issues such as this one that only show up after loading some
number of facts that are unrelated to the particular fact in question. &nbsp;&nbsp;It’s
difficult to debug because we can see that fact handles that satisfy the when
conditions are in the knowledge session (i.e. the same facts that fulfill the
Test rule), but we do not have any obvious way to debug why the expected HMM
Hit rule does not fire.<o:p></o:p></p>

<p class="MsoNormal">&nbsp;<o:p></o:p></p>

<p class="MsoNormal">Nelson<o:p></o:p></p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

</div>




</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></span><br></div></blockquote><br>

      </body></html>