Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1313

Memory Leak - but is this a supported scenario for Dynamic rule management

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 6.3.0.Final
    • core engine
    • None
    • Hide

      Run the attached reproducer and observer the ,dmp files using the MAT tool.

      Unfortunately I cannot attach my .dmp files as they are > 20MB.

      Show
      Run the attached reproducer and observer the ,dmp files using the MAT tool. Unfortunately I cannot attach my .dmp files as they are > 20MB.
    • User Experience
    • NEW
    • NEW

    Description

      I have a reproducer that shows a clear memory leak based on heap dumps created and reviewing them with the Eclipse Memory Analyzer tool (http://www.eclipse.org/mat/).

      However, I am not sure this is a supported scenario. If this is a supported approach this needs to get fixed, otherwise we need to use another approach.

      The attached source does this:
      Initialize stuff

      • Create a new ReleaseId
      • Create a new KieFileSystem
      • Generate and write the PomXML for the ReleaseId created above
      • Create a new KieModuleModel
      • Create a new KieBaseModel
      • Write the ModuleModel XML to the KieFileSystem
      • Write 2 rules into the KieFileSystem

      1st build and dump

      • Create a new KieBuilder
      • Do a buildall() with the KieBuilder
      • Create a new KieContainer
      • Create a new KieSession from the KieContainer
      • Print out the rules in the KieContainer for the package used in my rules
      • Create a java heap dump (SimpleTestFirstDump.dmp), see SimpleTestDump1.png as you can see we have 2 classloaders for each class created for these rules. This is not the leak, yet, just curious if this is expected.

      2nd build and dump

      • Delete 2 rules from the KieFileSystem created above
      • Call incrementalBuild() on the KieBuilder created above
      • Call updateToVersion() on the KieContaincer created above, using the SAME ReleaseID created above
      • Add 2 new rules to the KieFileSystem created above
      • Call incrementalBuild() on the KieBuilder created above
      • Call updateToVersion() on the KieContaincer created above, using the SAME ReleaseID created above
      • Print out the rules in the KieContainer for the package used in my rules
      • Create a java heap dump (SimpleTestSecondDump.dmp), see SimpleTestDump2.png.
      • Rule_120_Triggered_Part_1_ 0 is not there
      • Another class loader and instances of Rule_Internal_rule_0_DefaultConsequenceInvoker is present ( I think this is the leak)

      3rd build and dump

      • Delete 1 rule from the KieFileSystem created above
      • Call incrementalBuild() on the KieBuilder created above
      • Call updateToVersion() on the KieContaincer created above, using the SAME ReleaseID created above
      • Add 2 new rules to the KieFileSystem created above
      • Call incrementalBuild() on the KieBuilder created above
      • Call updateToVersion() on the KieContaincer created above, using the SAME ReleaseID created above
      • Print out the rules in the KieContainer for the package used in my rules
      • Create a java heap dump (SimpleTestThirdDump.dmp), see SimpleTestDump3.png.
      • Rule_120_Triggered_Part_1_ 0 is STILL not there
      • TWO more class loaders and instances of Rule_Internal_rule_0_DefaultConsequenceInvoker is present ( I think this is the leak)
      • Another class loader and instances of Rule_120_Triggered_part_10DefaultConsequenceInvoker is present ( I think this is also part of the leak)

      Attachments

        1. heap.png
          134 kB
          Mario Fusco
        2. SAVE_SimpleTest.java
          13 kB
          Bill Tuminaro
        3. SAVE_SimpleTest2.java
          8 kB
          Bill Tuminaro
        4. SAVE_SimpleTest4.java
          8 kB
          Bill Tuminaro
        5. SAVE_SimpleTest5.java
          10 kB
          Bill Tuminaro
        6. SimpleTest2_dump1.PNG
          48 kB
          Bill Tuminaro
        7. SimpleTest2_dump2.PNG
          61 kB
          Bill Tuminaro
        8. SimpleTest2_dump3.PNG
          67 kB
          Bill Tuminaro
        9. SimpleTestDump1.PNG
          41 kB
          Bill Tuminaro
        10. SimpleTestDump2.PNG
          36 kB
          Bill Tuminaro
        11. SimpleTestDump3.PNG
          46 kB
          Bill Tuminaro
        12. simpleTestThirdDump4.png
          47 kB
          Bill Tuminaro

        Activity

          People

            mfusco@redhat.com Mario Fusco
            billt408_jira Bill Tuminaro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: