You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Roman Stumm (JIRA)" <ji...@apache.org> on 2008/08/26 17:49:52 UTC

[jira] Created: (SM-1524) Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint

Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint
--------------------------------------------------------

                 Key: SM-1524
                 URL: https://issues.apache.org/activemq/browse/SM-1524
             Project: ServiceMix
          Issue Type: Bug
            Reporter: Roman Stumm


There is a memory leak in class org.apache.servicemix.drools.DroolsEndpoint, because the StatefulSession object must be released, otherwise the drools rulebase keeps a reference to it. 

(Description see drools docu: 
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.html#d0e900
Chapter 2.5.5
The StatefulSession extends the WorkingMemory class. It simply adds async methods and a dispose() method. The ruleBase retains a reference to each StatefulSession is creates, so that it can update them when new rules are added, dispose() is needed to release the StatefulSession reference from the RuleBase, without it you can get memory leaks.
)

Here is the fix: (replace methods drools() and createWorkingMemory() with those in  org.apache.servicemix.drools.DroolsEndpoint)

  protected void drools(MessageExchange exchange) throws Exception {
        StatefulSession memory = createWorkingMemory(exchange);
        try {
            populateWorkingMemory(memory, exchange);
            memory.fireAllRules();
        } finally {
            memory.dispose();
        }
    }
    
    protected StatefulSession createWorkingMemory(MessageExchange exchange) throws Exception {
        return ruleBase.newStatefulSession();
    }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SM-1524) Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated SM-1524:
--------------------------------

    Fix Version/s: servicemix-drools-2008.01

> Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint
> --------------------------------------------------------
>
>                 Key: SM-1524
>                 URL: https://issues.apache.org/activemq/browse/SM-1524
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-drools
>    Affects Versions: 3.2.1
>            Reporter: Roman Stumm
>            Assignee: Gert Vanthienen
>             Fix For: 3.3, servicemix-drools-2008.01
>
>
> There is a memory leak in class org.apache.servicemix.drools.DroolsEndpoint, because the StatefulSession object must be released, otherwise the drools rulebase keeps a reference to it. 
> (Description see drools docu: 
> http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.html#d0e900
> Chapter 2.5.5
> The StatefulSession extends the WorkingMemory class. It simply adds async methods and a dispose() method. The ruleBase retains a reference to each StatefulSession is creates, so that it can update them when new rules are added, dispose() is needed to release the StatefulSession reference from the RuleBase, without it you can get memory leaks.
> )
> Here is the fix: (replace methods drools() and createWorkingMemory() with those in  org.apache.servicemix.drools.DroolsEndpoint)
>   protected void drools(MessageExchange exchange) throws Exception {
>         StatefulSession memory = createWorkingMemory(exchange);
>         try {
>             populateWorkingMemory(memory, exchange);
>             memory.fireAllRules();
>         } finally {
>             memory.dispose();
>         }
>     }
>     
>     protected StatefulSession createWorkingMemory(MessageExchange exchange) throws Exception {
>         return ruleBase.newStatefulSession();
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (SM-1524) Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet reopened SM-1524:
---------------------------------

      Assignee: Gert Vanthienen  (was: Guillaume Nodet)

> Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint
> --------------------------------------------------------
>
>                 Key: SM-1524
>                 URL: https://issues.apache.org/activemq/browse/SM-1524
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-drools
>    Affects Versions: 3.2.1
>            Reporter: Roman Stumm
>            Assignee: Gert Vanthienen
>             Fix For: 3.3
>
>
> There is a memory leak in class org.apache.servicemix.drools.DroolsEndpoint, because the StatefulSession object must be released, otherwise the drools rulebase keeps a reference to it. 
> (Description see drools docu: 
> http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.html#d0e900
> Chapter 2.5.5
> The StatefulSession extends the WorkingMemory class. It simply adds async methods and a dispose() method. The ruleBase retains a reference to each StatefulSession is creates, so that it can update them when new rules are added, dispose() is needed to release the StatefulSession reference from the RuleBase, without it you can get memory leaks.
> )
> Here is the fix: (replace methods drools() and createWorkingMemory() with those in  org.apache.servicemix.drools.DroolsEndpoint)
>   protected void drools(MessageExchange exchange) throws Exception {
>         StatefulSession memory = createWorkingMemory(exchange);
>         try {
>             populateWorkingMemory(memory, exchange);
>             memory.fireAllRules();
>         } finally {
>             memory.dispose();
>         }
>     }
>     
>     protected StatefulSession createWorkingMemory(MessageExchange exchange) throws Exception {
>         return ruleBase.newStatefulSession();
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SM-1524) Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved SM-1524.
---------------------------------

         Assignee: Guillaume Nodet
    Fix Version/s: 3.3
       Resolution: Fixed

Sending        src/main/java/org/apache/servicemix/drools/DroolsEndpoint.java
Transmitting file data .
Committed revision 689860.



> Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint
> --------------------------------------------------------
>
>                 Key: SM-1524
>                 URL: https://issues.apache.org/activemq/browse/SM-1524
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-drools
>    Affects Versions: 3.2.1
>            Reporter: Roman Stumm
>            Assignee: Guillaume Nodet
>             Fix For: 3.3
>
>
> There is a memory leak in class org.apache.servicemix.drools.DroolsEndpoint, because the StatefulSession object must be released, otherwise the drools rulebase keeps a reference to it. 
> (Description see drools docu: 
> http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.html#d0e900
> Chapter 2.5.5
> The StatefulSession extends the WorkingMemory class. It simply adds async methods and a dispose() method. The ruleBase retains a reference to each StatefulSession is creates, so that it can update them when new rules are added, dispose() is needed to release the StatefulSession reference from the RuleBase, without it you can get memory leaks.
> )
> Here is the fix: (replace methods drools() and createWorkingMemory() with those in  org.apache.servicemix.drools.DroolsEndpoint)
>   protected void drools(MessageExchange exchange) throws Exception {
>         StatefulSession memory = createWorkingMemory(exchange);
>         try {
>             populateWorkingMemory(memory, exchange);
>             memory.fireAllRules();
>         } finally {
>             memory.dispose();
>         }
>     }
>     
>     protected StatefulSession createWorkingMemory(MessageExchange exchange) throws Exception {
>         return ruleBase.newStatefulSession();
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SM-1524) Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint

Posted by "Gert Vanthienen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gert Vanthienen resolved SM-1524.
---------------------------------

    Resolution: Fixed

> Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint
> --------------------------------------------------------
>
>                 Key: SM-1524
>                 URL: https://issues.apache.org/activemq/browse/SM-1524
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-drools
>    Affects Versions: 3.2.1
>            Reporter: Roman Stumm
>            Assignee: Gert Vanthienen
>             Fix For: 3.3
>
>
> There is a memory leak in class org.apache.servicemix.drools.DroolsEndpoint, because the StatefulSession object must be released, otherwise the drools rulebase keeps a reference to it. 
> (Description see drools docu: 
> http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.html#d0e900
> Chapter 2.5.5
> The StatefulSession extends the WorkingMemory class. It simply adds async methods and a dispose() method. The ruleBase retains a reference to each StatefulSession is creates, so that it can update them when new rules are added, dispose() is needed to release the StatefulSession reference from the RuleBase, without it you can get memory leaks.
> )
> Here is the fix: (replace methods drools() and createWorkingMemory() with those in  org.apache.servicemix.drools.DroolsEndpoint)
>   protected void drools(MessageExchange exchange) throws Exception {
>         StatefulSession memory = createWorkingMemory(exchange);
>         try {
>             populateWorkingMemory(memory, exchange);
>             memory.fireAllRules();
>         } finally {
>             memory.dispose();
>         }
>     }
>     
>     protected StatefulSession createWorkingMemory(MessageExchange exchange) throws Exception {
>         return ruleBase.newStatefulSession();
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SM-1524) Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint

Posted by "Gert Vanthienen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45275#action_45275 ] 

Gert Vanthienen commented on SM-1524:
-------------------------------------

Fixed in http://svn.eu.apache.org/viewvc?view=rev&revision=690960

> Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint
> --------------------------------------------------------
>
>                 Key: SM-1524
>                 URL: https://issues.apache.org/activemq/browse/SM-1524
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-drools
>    Affects Versions: 3.2.1
>            Reporter: Roman Stumm
>            Assignee: Gert Vanthienen
>             Fix For: 3.3
>
>
> There is a memory leak in class org.apache.servicemix.drools.DroolsEndpoint, because the StatefulSession object must be released, otherwise the drools rulebase keeps a reference to it. 
> (Description see drools docu: 
> http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.html#d0e900
> Chapter 2.5.5
> The StatefulSession extends the WorkingMemory class. It simply adds async methods and a dispose() method. The ruleBase retains a reference to each StatefulSession is creates, so that it can update them when new rules are added, dispose() is needed to release the StatefulSession reference from the RuleBase, without it you can get memory leaks.
> )
> Here is the fix: (replace methods drools() and createWorkingMemory() with those in  org.apache.servicemix.drools.DroolsEndpoint)
>   protected void drools(MessageExchange exchange) throws Exception {
>         StatefulSession memory = createWorkingMemory(exchange);
>         try {
>             populateWorkingMemory(memory, exchange);
>             memory.fireAllRules();
>         } finally {
>             memory.dispose();
>         }
>     }
>     
>     protected StatefulSession createWorkingMemory(MessageExchange exchange) throws Exception {
>         return ruleBase.newStatefulSession();
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SM-1524) Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint

Posted by "Roman Stumm (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Stumm updated SM-1524:
----------------------------

    Affects Version/s: 3.2.1
          Component/s: servicemix-drools

> Fix for Memory Leak in ServiceMix-Drools4 DroolsEndpoint
> --------------------------------------------------------
>
>                 Key: SM-1524
>                 URL: https://issues.apache.org/activemq/browse/SM-1524
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-drools
>    Affects Versions: 3.2.1
>            Reporter: Roman Stumm
>
> There is a memory leak in class org.apache.servicemix.drools.DroolsEndpoint, because the StatefulSession object must be released, otherwise the drools rulebase keeps a reference to it. 
> (Description see drools docu: 
> http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html_single/index.html#d0e900
> Chapter 2.5.5
> The StatefulSession extends the WorkingMemory class. It simply adds async methods and a dispose() method. The ruleBase retains a reference to each StatefulSession is creates, so that it can update them when new rules are added, dispose() is needed to release the StatefulSession reference from the RuleBase, without it you can get memory leaks.
> )
> Here is the fix: (replace methods drools() and createWorkingMemory() with those in  org.apache.servicemix.drools.DroolsEndpoint)
>   protected void drools(MessageExchange exchange) throws Exception {
>         StatefulSession memory = createWorkingMemory(exchange);
>         try {
>             populateWorkingMemory(memory, exchange);
>             memory.fireAllRules();
>         } finally {
>             memory.dispose();
>         }
>     }
>     
>     protected StatefulSession createWorkingMemory(MessageExchange exchange) throws Exception {
>         return ruleBase.newStatefulSession();
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.