[jboss-jira] [JBoss JIRA] (JBRULES-3583) Retracting an event with an explicit expiration results in memory leak

Ladd Asper (JIRA) jira-events at lists.jboss.org
Tue Jul 24 09:09:06 EDT 2012


Ladd Asper created JBRULES-3583:
-----------------------------------

             Summary: Retracting an event with an explicit expiration results in memory leak
                 Key: JBRULES-3583
                 URL: https://issues.jboss.org/browse/JBRULES-3583
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core
    Affects Versions: 5.4.0.Final
         Environment: Windows 7, Java 1.6
            Reporter: Ladd Asper
            Assignee: Mark Proctor


package drools.tests
import drools.tests.MyEvent
import java.util.List
declare MyEvent @role(event) @expires(14d) end   // <====== leaks
//declare MyEvent @role(event) end               // <====== doesn't leak
		
rule "UpdateAndRetractOldEvents"
    salience 10000
when
    $old : MyEvent( $key : key )
    MyEvent( key == $key, this after $old )
then
    retract( $old );
    System.err.println( "retracted $old" );
end

My test case is a loop that does this:

MyEvent firstA = new MyEvent( "first", "firstA" ); // key, value
MyEvent firstB = new MyEvent( "first", "firstB" ); // key, value
...
ksession.insert( firstA );
ksession.fireAllRules();
Thread.sleep( 50 );
ksession.insert( firstB );
ksession.fireAllRules();

Memory consumption stays flat if MyEvent is declared without an expiration time.  Memory consumption increases linearly if MyEvent is declared with an expiration time.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list