[jboss-jira] [JBoss JIRA] (DROOLS-521) ClassLoader leak in 6.0.1 Final when building incrementally

Mario Fusco (JIRA) issues at jboss.org
Wed Jun 11 11:57:38 EDT 2014


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

Mario Fusco resolved DROOLS-521.
--------------------------------

    Fix Version/s: 6.1.0.Final
       Resolution: Done


> ClassLoader leak in 6.0.1 Final when building incrementally
> -----------------------------------------------------------
>
>                 Key: DROOLS-521
>                 URL: https://issues.jboss.org/browse/DROOLS-521
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 6.0.1.Final
>            Reporter: Craig West
>            Assignee: Mario Fusco
>             Fix For: 6.1.0.Final
>
>
> I am currently converting a Drools 5.5.0 installation to 6.0.1 Final,
> due to many memory leaks in 5.5.0. Our use case involves a
> knowledgebase of several thousand rules which are updated at run-time
> quite frequently. As a result, we have found it necessary to do
> incremental builds of rules. I based the code for this on the
> integration tests:
> https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java
> This is working fairly well so far, but while testing, I noticed a
> fairly severe increase in PermGen heap usage every time I modify my
> rules.
> Using jhat and the Eclipse memory analyzer, I was able to track down
> the source of the problem to a classloader leak in the JavaDialect
> class. Whenever a rule is added to the JavaDialect, a RuleErrorHandler
> is added to an internal Map named errorHandlers. Unfortunately, this
> RuleErrorHandler is never removed, and it contains a reference to a
> stale PackageClassLoader. I have successfully fixed this by adding a call to this.errorHandlers.clear(); at the end of JavaDialect.compileAll().
> As far as I have been able to determine, the errorHandlers map is no longer necessary at this point, and any further calls to compileAll should be preceded by updated addRule calls  



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the jboss-jira mailing list