[jboss-jira] [JBoss JIRA] Updated: (JBRULES-2315) DroolsMVELFactory leaks memory in previousDeclarationsObjectCache field using "from" DRL construct

Kurt Westerfeld (JIRA) jira-events at lists.jboss.org
Wed Oct 21 22:17:05 EDT 2009


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

Kurt Westerfeld updated JBRULES-2315:
-------------------------------------


This is the basic gist of the patch required to the two classes involved.

diff -br org/drools/base/dataproviders/MVELDataProvider.java main\java\org/drools/base/dataproviders/MVELDataProvider.ja
va
40d39
<
93a93,94
>         factory.clear();
>
diff -br org/drools/base/mvel/DroolsMVELFactory.java main\java\org/drools/base/mvel/DroolsMVELFactory.java
382a383,391
>
>     /**
>      * Clear cached information from the previous declerations
>      */
>     public void clear() {
>         this.previousDeclarationsObjectCache = new HashMap<String, Object>();
>         this.tupleObjects = new InternalFactHandle[0];
>         this.localVariables = new HashMap();
>     }

> DroolsMVELFactory leaks memory in previousDeclarationsObjectCache field using "from" DRL construct
> --------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-2315
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2315
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core  (expert)
>    Affects Versions: 5.0.1.FINAL
>         Environment: Windows/any
>            Reporter: Kurt Westerfeld
>            Assignee: Mark Proctor
>
> When using the DRL construct to extract variables using a "from" clause, a FromNode is created which extracts data using an instance of DroolsMVELFactory paired with MVELDataProvider.  After processing of rule agenda items, many of these nodes can exist and hold onto memory due to the snapshot of data processed during DroolsMVELFactory.setContext(), called from MVELDataProvider.getResults().  The snapshotting of state is held in (HashMap) previousDeclarationsObjectCache of DroolsMVELFactory.
> Suggest that during MVELDataProvider.getResults() call clear on the DroolsMVELFactory after obtaining the results.  The clear method could clear out previousDeclarationsObjectCache, which is used during the processing of the MVEL expression.
> In my application, much data held from these nodes kept instances of data in memory, even though the data was never asserted into working memory.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list