[rules-users] Memory usage tied to rule report?

Edson Tirelli tirelli at post.com
Tue Sep 7 20:39:26 EDT 2010


    Jared,

    Which version of Drools are you using? Drools 5.1 massively
reduces memory consumption for long-running stateful sessions, when
there are lots of update/modify calls, when compared to Drools 5.0.

    Also, in 5.1 there is an internal report you can run. I did not
exposed this in drools-api yet, because I am still not happy with the
overall API... so, maybe you can try using it and provide feedback on
how you would improve it and we may eventually publish it on the next
version.

    Anyway, to use it, after you have your session loaded with some data:

        SessionInspector inspector = new SessionInspector( ksession );
        StatefulKnowledgeSessionInfo info = inspector.getSessionInfo();
        SessionReporter.addNamedTemplate( "topten",
getClass().getResourceAsStream( "customreports.mvel" ) );
        String report = SessionReporter.generateReport( "topten", info, null );

    The file referenced above (customreports.mvel) can be found here:

http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/util/debug/customreports.mvel

     Just add it to your classpath. Feel free to change it as you see
fit, but as is it will give you the top ten left and right node
memories.

     Edson



2010/9/7 Jared Davis <sunray at davisprogramming.com>:
>
> Hi,
>
> I'm attempting to track down an out of memory error.
>
> I have ~400 rules that operate on ~10000 facts. One set of facts throws an
> out of memory error while other sets process w/o an error. It is easy to
> reproduce.
>
> When the system runs out of memory there are about 22,000,000 ReteTuple
> objects active.
>
> I assume I have a bad rule producing a large cross product.
>
> How do I find it?
>
> Is there an audit tool that will let me tie ReteTuple back to a specific
> rule?
>
> Regards,
>
> Jared Davis
>
>
>
> --
> View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Memory-usage-tied-to-rule-report-tp1434387p1434387.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com




More information about the rules-users mailing list