[jboss-jira] [JBoss JIRA] (DROOLS-1233) Memory references to removed facts are retained for certain rules

Jon Kranes (JIRA) issues at jboss.org
Wed Jul 20 17:02:00 EDT 2016


     [ https://issues.jboss.org/browse/DROOLS-1233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jon Kranes updated DROOLS-1233:
-------------------------------
    Steps to Reproduce: Run the attached unit test in debug mode with a breakpoint at System.out line specified.  While the program is paused take a heap dump using jvisualvm after performing a GC.  The heap dump will show instances of TestClass remain in memory even though they have been removed from the session.  The attached screen shots show the jvisualvm class view and the reference path from an instance of TestClass to the drools Session.  Note that the heap dump shows that Drools is holding 200,000 instances of DefaultFactHandle, which includes the 100,000 expected instances corresponding to 100,000 instances of TestClass2, but also an additional 100,000 instances corresponding to the removed facts for instances of TestClass.  These additional 100,000 DefaultFactHandle instances in memory are not available through the KieSession API and thus cannot be programmatically removed in any obvious way.  (was: Run the attached unit test in debug mode with a breakpoint at System.out line specified.  While the program is paused take a heap dump using jvisualvm after performing a GC.  The heap dump will show instances of TestClass remain in memory even though they have been removed from the session.  The attached screen shots show the jvisualvm class view and the reference path from an instance of TestClass to the drools Session.)


> Memory references to removed facts are retained for certain rules
> -----------------------------------------------------------------
>
>                 Key: DROOLS-1233
>                 URL: https://issues.jboss.org/browse/DROOLS-1233
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 6.4.0.Final
>            Reporter: Jon Kranes
>            Assignee: Mario Fusco
>         Attachments: drools-memory-test.zip, gc-root.jpg, gc-root.tiff, heap-dump.jpg, heap-dump.tiff
>
>
> Given a simple rule of a specific pattern, Drools maintains references in a stateful session to fact objects even after the facts have been withdrawn from working memory.
> For example, given the following rule:
> {code}
> rule "TestRule"
> 	when
> 		$tc : TestClass()
> 		not TestClass2(name == $tc.name)
> 	then
> 		insert(new TestClass2($tc.getName()));
> 	end
> {code}
> Drools will maintain an internal reference to instances of TestClass even after they have been explicitly deleted from the session.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)



More information about the jboss-jira mailing list