<div>Thanks, I&#39;ll try.</div>
<div>But&nbsp;we construct the RuleBase before any connection is being made to the server.<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 7/4/07, <b class="gmail_sendername">Mark Proctor</b> &lt;<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div text="#000000" bgcolor="#ffffff">I think it&#39;s 3. I notice that while we lock existing WMs during package addition, we don&#39;t block new WMs being created. I&#39;ve added syncronised blocks on the package map in the relevant places, I hope this fixes the issue.
<br><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://jira.jboss.org/jira/browse/JBRULES-971" target="_blank">http://jira.jboss.org/jira/browse/JBRULES-971</a><br><br>Could you try trunk and let me know?
<br><span class="sg"><br>Mark</span> 
<div><span class="e" id="q_1139223df536b3e0_2"><br>Mark Proctor wrote: 
<blockquote type="cite">actually I thought i tracked it down, was wrong. Anyway once the RuleBase is built the &quot;ObjectHashMap objectTypeNodes&quot; in Rete should not change....Only I things I can think of are:<br>1) Some how a thread is seeing a stale version of the map
<br>2) the rulebase is getting updated while propagation is happening, maybe combine with an issue from 1. In reality the rulebase addition should obey the standard locking mechanism and stop this from happening.<br>3) The initial RuleBase hasn&#39;t finished building yet, and threads are already being spun off to assert data.
<br><br>I have a feeling its 3...<br><br>Mark<br>Mark Proctor wrote: 
<blockquote type="cite">ok, that might be it. We generate code in a singleton classloader, I suspect that each thread is generating its&#39; own getters. I suspect that created singleton classloader is not getting GCd and releasing the perm gen. I&#39;m not sure how to fix this. You can check this yourself by attaching a jprofiler instance (available for free trial) and looking at the object counts.
<br><br>I&#39;ve tracked down the concurrency issue. The Rete node has a HashMap of ObjectTypeNodes that is built on the fly, that was global to the rulebase. I&#39;ll have to make it local to the working Memory. I&#39;ll fix that today.
<br><br>Mark<br>s erel wrote: 
<blockquote type="cite">
<div>Our server creates hundreds of stateful rule sessions concurrently. Each created rule seesion is specific to a thread. We did not encounter </div>
<div>any memory problems with the previous version. As I&#39;ve said, it&#39;s&nbsp;difficult (actually, impossible) for me to provide you with a self contained example </div>
<div>since&nbsp;the drl is&nbsp;complicated and contains&nbsp;dozens of complex objects. However, I am ready to provide you with any information that can help</div>
<div>us in that manner.</div>
<div>I&#39;ve also mentioned in the earlier threads the concurrency problem I&#39;ve encountered with AbstractHashTable. </div>
<div>Can this has something to do with it?</div>
<div><br>&nbsp;</div>
<div><span class="gmail_quote">On 7/4/07, <b class="gmail_sendername">Mark Proctor</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">I don&#39;t beleive there is anything in 4.0 that is going to cause such quick loss of permgen. Can you create a self contained example that illustrates this behaviour? So we can reproduce this? 
<br><span><br>Mark</span> 
<div><span><br>s erel wrote: 
<blockquote type="cite">
<div>We&#39;ve tried to increase the permGen to 256mb. It did not help and the space run out really fast.</div>
<div>Regarding MVEL, is turning&nbsp;code generation off&nbsp;something that can (or will)&nbsp;be done&nbsp;with a configuration parameter/factory method or do I need to track down all the places in the code?</div>
<div>&nbsp;</div>
<div>We did not experience such memory behavior with the previous version we used (3.06) when running&nbsp;the same tests.</div>
<div>Bugs in 3.06&nbsp;(no longer present in 4M3)&nbsp;are forcing us to upgrade.</div>
<div>&nbsp;</div>
<div>Is there another reason for such behaviour?</div>
<div>Should we wait for release candidate?</div>
<div><br>&nbsp;</div>
<div><span class="gmail_quote">On 7/4/07, <b class="gmail_sendername">Mark Proctor</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org 
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">increase your perm gen space,or use the MVEL dialect with code generation off. 
<div><span><br><br>Mark<br>s erel wrote: 
<blockquote type="cite">
<div>Hello,</div>
<div>&nbsp;</div>
<div>During capacity tests we&#39;ve received permGen OOM exception.&nbsp;The occupied space&nbsp;in the permGen area increases rapidly. Any opinions?</div><br><br>
<div><span class="gmail_quote">On 7/3/07, <b class="gmail_sendername">s erel</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:erelsagi@gmail.com" target="_blank">erelsagi@gmail.com</a>&gt; wrote: 
</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>In&nbsp;our project we are&nbsp;creating a StatefulRuleSession&nbsp;and saving it in a per-thread context (i.e. Each thread has it&#39;s own StatefulRuleSession):</div>
<div>&nbsp;</div>
<div>ruleServiceProvider.getRuleRuntime().createRuleSession(contextName, properties, RuleRuntime.STATEFUL_SESSION_TYPE);</div>
<div>&nbsp;</div>
<div>When a thread session ends, we are calling release on the previously created StatefulRuleSession.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Changing the following lines:</div>
<div>&nbsp;</div>
<div>
<p>public abstract class AbstractHashTable<br>&nbsp;&nbsp;</p>
<p>...</p>
<p>&nbsp;&nbsp;&nbsp; public Iterator iterator() {<br>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( this.iterator == null ) {<br>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.iterator = new HashTableIterator( this );<br>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>//<br>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.iterator.reset();<br>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 
this.iterator;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HashTableIterator iterator = new HashTableIterator(this);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iterator.reset();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return iterator;<br>&nbsp;&nbsp;&nbsp; }</p>Seems to solve the problem I&#39;ve encountered. What&#39;s your opinion?<br><br>&nbsp;</div>
<div><span>
<div><span class="gmail_quote">On 7/2/07, <b class="gmail_sendername">Mark Proctor</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org 
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">a working memory should be single threaded, so not sure how this could be a race condition?<br><span><br>Mark</span> 
<div><span><br>s erel wrote: 
<blockquote type="cite">
<div>I&#39;ve done a little debugging. The code fails in&nbsp;the following segment:</div>
<div>&nbsp;</div>
<div>public static class HashTableIterator</div>
<div>...</div>
<div>&nbsp;while ( this.entry == null ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.row++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( this.row == this.length ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return null;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.entry
 = this.table[this.row]; <strong>// ---&gt; index out of bounds exception</strong><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div>
<div>}<br>&nbsp;</div>
<div>this.row has the same value as this.length despite the condition above it. Probably a race condition issue.</div>
<div><br>&nbsp;</div>
<div><span class="gmail_quote">On 7/2/07, <b class="gmail_sendername">Mark Proctor</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org 
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">Not really :(<br><br>In your situation I tend to keep removing rules and data while still making sure the error happens, to get it down to a minimum. Please do try, as this isn&#39;t an error that should happen. Or alterntaively you can open drools-core and drools-compiler in eclipse and execuse and debug this yourself - in your situation this might best. you can put in a breakpoint to listen for that particular exception. 
<br><span><br>Mark</span> 
<div><span><br>s erel wrote: 
<blockquote type="cite">
<div>It&#39;s hard for me to provide a self contained project. The drl is&nbsp;long and&nbsp;uses several business objects. It&#39;s the same drl as we&#39;ve been using for 306 minus the keyword changes. </div>
<div>Is there anything else i can check or provide you in order to solve this matter.</div>
<div>&nbsp;</div>
<div>Thanks<br>&nbsp;</div>
<div><span class="gmail_quote">On 7/1/07, <b class="gmail_sendername">Mark Proctor</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org 
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">Can you provide us a self contained project which creates this error? Unless we can recreate it, it will be very hard to track it down. Please attach the project to a jira and we&#39;ll make it a priority. 
<br><br>Mark<br>s erel wrote: 
<blockquote type="cite">
<div><span>
<div>Hello,</div>
<div>&nbsp;</div>
<div>I&#39;ve just started integrating&nbsp;MR3&nbsp;into my project (I&#39;ve previously used&nbsp;3.06).&nbsp;The drl&nbsp;compiles and everything seems fine, but during </div>
<div>tests the following exception is thrown for time to time:</div>
<div>&nbsp;</div>
<div>java.lang.ArrayIndexOutOfBoundsException: 17<br>&nbsp;at org.drools.util.AbstractHashTable$HashTableIterator.next(AbstractHashTable.java:250)<br>&nbsp;at org.drools.reteoo.Rete$ObjectTypeConf.buildCache(Rete.java:434)<br>&nbsp;at 
org.drools.reteoo.Rete$ObjectTypeConf.getObjectTypeNodes(Rete.java:425)<br>&nbsp;at org.drools.reteoo.Rete.assertObject(Rete.java:172)<br>&nbsp;at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)<br>&nbsp;at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute
 (ReteooWorkingMemory.java:163)<br>&nbsp;at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1135)<br>&nbsp;at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:781)<br>
&nbsp;at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:584)<br>&nbsp;at org.drools.jsr94.rules.StatefulRuleSessionImpl.addObject(StatefulRuleSessionImpl.java:162)</div>
<div>&nbsp;</div>
<div>This only happens during high load tests.</div>
<div>Can anyone help me?</div>
<div>&nbsp;</div>
<div>Thanks</div>
<div>&nbsp;</div></span></div><pre><hr width="90%" size="4">
_______________________________________________
rules-users mailing list
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre></blockquote><br>&nbsp;</div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">
rules-users@lists.jboss.org </a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users 
</a><br><br></blockquote></div><br><pre><hr width="90%" size="4">
_______________________________________________
rules-users mailing list
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre></blockquote><br></span></div></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users 
</a><br><br></blockquote></div><br><pre><hr width="90%" size="4">
_______________________________________________
rules-users mailing list
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre></blockquote><br></span></div></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users 
</a><br><br></blockquote></div><br></span></div></blockquote></div><br><pre><hr width="90%" size="4">
_______________________________________________
rules-users mailing list
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre></blockquote><br></span></div></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users 
</a><br><br></blockquote></div><br><pre><hr width="90%" size="4">
_______________________________________________
rules-users mailing list
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre></blockquote><br></span></div></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users 
</a><br><br></blockquote></div><br><pre><hr width="90%" size="4">
_______________________________________________
rules-users mailing list
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre></blockquote><br><pre><hr width="90%" size="4">
_______________________________________________
rules-users mailing list
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre></blockquote><br><pre><hr width="90%" size="4">
_______________________________________________
rules-users mailing list
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre></blockquote><br></span></div></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br><br></blockquote></div><br>