[rules-users] BRMS Server - memory Issue while execution - Critical

Arjun Dhar dhar_ar at yahoo.com
Fri Jul 20 12:16:22 EDT 2007


Hi,
 I've been building a BRMS server over the Drools 4MR2 API.

The Server has a Boot process to allow to make it become a Rule server(s). 
reads and XML configuration in which a user can specify the location of the 
DRL, XLS, CVS, etc. During the Boot proocess it verifies thew authenticity of 
each resource it loads. To sommarize:

 <Session 1 type="Stateless">
    <Rule Source 1>
    <Rule Source 2>
    ..
    <Adapter ExternalService class="..."/>
 <Session>

 <Session 2 type="Stateful">
    <Rule Source 1>
    <Rule Source 2>
    ..
 <Session>
..well its more, but I guess this paints the picture.


It creates a Pool of Sessions. Now I know creating a Session is inexpensive, 
but the process of creating them and authentication of resources etc. (Required 
for prodcution quality system)

Once the server is up, requests are serviced. the request knows which session 
it wants and facts are asserted per request. The request can be Synchronous or 
Async and single or batch.

For testing I'm using: (JMeter test Case)
Session mode: STATELESS
Synchronous
Mode: Batch of 5 facts (composing of other objects (about 5) which are asserted 
into the Session as well) at at a time
Loop: 10,000 <-- Does not matter how fast or slow I trow this at the engine

After the request is processed and results logged; Result and what rules led to 
that result. I even nullify the top level Business obejcts. (a desperate 
attempt to free memory)

After about 10,000 loops the System goes out of memory. 
Sorry to bore you so far, but it was important you have the right context :o)

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 
com.myserver.brms.services.execute.recore.batch.ExecuteSessionBatch.executeBatch
(ExecuteSessionBatch.java:160)

Please help me! This is the only downtime issue I face and unfortunatley its 
the most critical point of failure.

All thats left is to build an RMI service with a console dameon shell to give 
it the final touches. Once this is done i'd like to share the deisng with you 
guys if you like it.




More information about the rules-users mailing list