<!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">
Arjun Dhar wrote:
<blockquote cite="mid:loom.20070720T185440-223@post.gmane.org"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">QUESTION:: Is the session maintaining references to those objects ever after 
executing them? Why are the objects not being released? 

Specially I'd imagine for a STATELESS session (which is what I've set as 
default).

Using JMeter this system crashes every time under load, even with a single 
Thread. Clearly objects are not being released.

The error I get may help you: (Along with out of memory). This exception only 
comes under Load conditions.
Admin:ERROR: [com.myserver.brms.demos.certify.web.servlet.CertifyWebRequests]
[service] :org.drools.spi.ConsequenceException: java.lang.NullPointerException

        at org.drools.common.DefaultAgenda.fireActivation
(DefaultAgenda.java:501)

        at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:461)

        at org.drools.common.AbstractWorkingMemory.fireAllRules
(AbstractWorkingMemory.java:373)

        at org.drools.reteoo.ReteooStatelessSession.execute
(ReteooStatelessSession.java:72)

        at com.myserver.brms.sessions.RulesEngineSessionJBossRules4.execute
(RulesEngineSessionJBossRules4.java:113)
at 

    </pre>
  </blockquote>
  <pre wrap=""><!---->com.myserver.brms.services.execute.recore.batch.ExecuteSessionBatch.executeBatch
  </pre>
  <blockquote type="cite">
    <pre wrap="">(ExecuteSessionBatch.java:160)

Please help me! This is the only downtime issue I face and unfortunatley its 
the most critical point of failure.
    </pre>
  </blockquote>
  <pre wrap=""><!---->

Ok, I think I figured it out. But please confirm.

The Rule Engine Session DOES NOT release objects. (But hten why have a 
Stateless session?) if the duration of use of the session is not going to be 
long?

The solution: Pool the RuleBase and on a request createa freesh session from it 
each time a request comes in!

Let me know if the cocept is sound or what I'm thinking is now correct.

Thanks,
Arjun




_______________________________________________
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>
Stateless sessions should not hold onto any references. Stateful do,
and dispose() must be called when its finished - otherwise the rulebase
holds a reference forever. If the rulebase is holding onto stateless
sessions, then that is a bug.<br>
<br>
Mark<br>
</body>
</html>