Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1325

OutOfMemory with the use of WorkingMemoryFileLogger

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 4.0.3
    • Fix Version/s: 4.0.4, 5.0.0.M1
    • Component/s: None
    • Labels:
      None
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      don't use the WorkingMemoryLogger or remove EventListener before dispose the session :
      session.removeEventListener((WorkingMemoryEventListener)logger);
      session.removeEventListener((AgendaEventListener)logger);
      session.removeEventListener((RuleFlowEventListener)logger);
      session.removeEventListener((RuleBaseEventListener)logger);

      Show
      don't use the WorkingMemoryLogger or remove EventListener before dispose the session : session.removeEventListener((WorkingMemoryEventListener)logger); session.removeEventListener((AgendaEventListener)logger); session.removeEventListener((RuleFlowEventListener)logger); session.removeEventListener((RuleBaseEventListener)logger);
    • Estimated Difficulty:
      Low

      Description

      Hello,

      In my tests of the 4.0.3, I have some : java.lang.OutOfMemoryError.

      So, I try a simple test with 10.000 sequential execution of 1 rule with no context and just a workingmemorylogger and I have the error : java.lang.OutOfMemoryError: Java heap space

      My code is :

      public class ExecReglesMemotyTest
      {

      private static final Reader DRL = new InputStreamReader(ExecReglesMemotyTest.class
      .getResourceAsStream("/rules/exemple.drl"));

      private static final String FICHIER_LOG = "session";

      /**

      • @param args
        */
        public static void main(String[] args)
        {
        try
        {
        PackageBuilder builder = new PackageBuilder();
        builder.addPackageFromDrl(DRL);
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage(builder.getPackage());
        for (int i = 0; i < 10000; i++) { StatefulSession session = ruleBase.newStatefulSession(); WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger(session); logger.setFileName(FICHIER_LOG); session.fireAllRules(); logger.writeToDisk(); session.dispose(); }

      }
      catch (Exception e)

      { // TODO Auto-generated catch block e.printStackTrace(); }

      }
      }

      with this rule (doesn't matter):
      #created on: Fri Nov 09 15:48:45 CET 2007
      package initPackage

      #list any import classes here.

      rule "ERG9"
      when

      then

      end

      I try this in 4.0.1, and it's working (no OutOfMemoryError)

      What's the problem ?

      thanks for any information,

      V.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tirelli Edson Tirelli
                  Reporter:
                  vdelbart Delbart Vincent
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: