<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
actually I thought i tracked it down, was wrong. Anyway once the
RuleBase is built the "ObjectHashMap objectTypeNodes" 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'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 cite="mid:468BC383.6090405@codehaus.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
ok, that might be it. We generate code in a singleton classloader, I
suspect that each thread is generating its' own getters. I suspect that
created singleton classloader is not getting GCd and releasing the perm
gen. I'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'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'll have to make it local to the working Memory. I'll fix
that today.<br>
<br>
Mark<br>
s erel wrote:
<blockquote
cite="mid:1a1500b50707040618k561aa016w3f4d48e0b3c7f0c5@mail.gmail.com"
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've said,
it's difficult (actually, impossible) for me to provide you with a self
contained example </div>
<div>since the drl is complicated and contains 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've also mentioned in the earlier threads the concurrency
problem I've encountered with AbstractHashTable. </div>
<div>Can this has something to do with it?</div>
<div><br>
</div>
<div><span class="gmail_quote">On 7/4/07, <b
class="gmail_sendername">Mark
Proctor</b> <<a moz-do-not-send="true"
href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>>
wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">I don'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 class="sg"><br>
Mark</span>
<div><span class="e" id="q_1139121159cb6e46_2"><br>
s erel wrote:
<blockquote type="cite">
<div>We'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 code generation off something
that can (or will) be done with a configuration parameter/factory
method or do I need to track down all the places in the code?</div>
<div> </div>
<div>We did not experience such memory behavior with the
previous
version we used (3.06) when running the same tests.</div>
<div>Bugs in 3.06 (no longer present in 4M3) are forcing us to
upgrade.</div>
<div> </div>
<div>Is there another reason for such behaviour?</div>
<div>Should we wait for release candidate?</div>
<div><br>
</div>
<div><span class="gmail_quote">On 7/4/07, <b
class="gmail_sendername">Mark Proctor</b> <<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org
</a>> wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<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> </div>
<div>During capacity tests we've received permGen OOM
exception. The occupied space 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> <<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:erelsagi@gmail.com" target="_blank">erelsagi@gmail.com</a>>
wrote: </span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div>In our project we are creating a
StatefulRuleSession and saving it in a per-thread context (i.e. Each
thread has it's own StatefulRuleSession):</div>
<div> </div>
<div>ruleServiceProvider.getRuleRuntime().createRuleSession(contextName,
properties, RuleRuntime.STATEFUL_SESSION_TYPE);</div>
<div> </div>
<div>When a thread session ends, we are calling release
on
the previously created StatefulRuleSession.</div>
<div> </div>
<div> </div>
<div>Changing the following lines:</div>
<div> </div>
<div>
<p>public abstract class AbstractHashTable<br>
</p>
<p>...</p>
<p> public Iterator iterator() {<br>
// if ( this.iterator == null ) {<br>
// this.iterator = new HashTableIterator( this );<br>
// }<br>
//<br>
// this.iterator.reset();<br>
// return this.iterator;</p>
<p> HashTableIterator iterator = new
HashTableIterator(this);<br>
iterator.reset();</p>
<p> return iterator;<br>
}</p>
Seems to solve the problem I've encountered. What's your opinion?<br>
<br>
</div>
<div><span>
<div><span class="gmail_quote">On 7/2/07, <b
class="gmail_sendername">Mark Proctor</b> <<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org
</a>> wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<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've done a little debugging. The code fails
in the following segment:</div>
<div> </div>
<div>public static class HashTableIterator</div>
<div>...</div>
<div> while ( this.entry == null ) {<br>
this.row++;<br>
if ( this.row == this.length ) {<br>
return null;<br>
}<br>
this.entry = this.table[this.row]; <strong>//
---> index out of bounds exception</strong><br>
}</div>
<div>}<br>
</div>
<div>this.row has the same value as this.length
despite
the condition above it. Probably a race condition issue.</div>
<div><br>
</div>
<div><span class="gmail_quote">On 7/2/07, <b
class="gmail_sendername">Mark Proctor</b> <<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org
</a>> wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<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'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's hard for me to provide a self contained
project. The drl is long and uses several business objects. It's the
same drl as we'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> </div>
<div>Thanks<br>
</div>
<div><span class="gmail_quote">On 7/1/07, <b
class="gmail_sendername">Mark Proctor</b> <<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org
</a>> wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<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'll make it a priority. <br>
<br>
Mark<br>
s erel wrote:
<blockquote type="cite">
<div><span>
<div>Hello,</div>
<div> </div>
<div>I've just started integrating MR3 into
my
project (I've previously used 3.06). The drl compiles and everything
seems fine, but during </div>
<div>tests the following exception is thrown
for time to time:</div>
<div> </div>
<div>java.lang.ArrayIndexOutOfBoundsException:
17<br>
at
org.drools.util.AbstractHashTable$HashTableIterator.next(AbstractHashTable.java:250)<br>
at org.drools.reteoo.Rete$ObjectTypeConf.buildCache(Rete.java:434)<br>
at
org.drools.reteoo.Rete$ObjectTypeConf.getObjectTypeNodes(Rete.java:425)<br>
at org.drools.reteoo.Rete.assertObject(Rete.java:172)<br>
at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)<br>
at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute
(ReteooWorkingMemory.java:163)<br>
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1135)<br>
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:781)<br>
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:584)<br>
at
org.drools.jsr94.rules.StatefulRuleSessionImpl.addObject(StatefulRuleSessionImpl.java:162)</div>
<div> </div>
<div>This only happens during high load tests.</div>
<div>Can anyone help me?</div>
<div> </div>
<div>Thanks</div>
<div> </div>
</span></div>
<pre><hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true"
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>
</div>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a moz-do-not-send="true"
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 moz-do-not-send="true"
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 size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true"
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 moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
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 wrap=""><hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>