[rules-users] permgen leak

Davide Sottara dsotty at gmail.com
Mon Dec 16 14:36:25 EST 2013


The fix was merged this morning in 5.6.0-SNAPSHOT.
It requires an explicit disposal of both the KnowledgeBuilder and
the KnowledgeBase once you are done with them:

KnowledgeBuilder builder = ...
KnowledgeBase kBase = ...

...
( (KnowledgeBuilderImpl) builder ).dispose();

... // create, use and dispose sessions here

( (KnowledgeBaseImpl) kBase ).dispose();

Of course you need appropriate initial/max permgen to allocate at
least the largest KB.
I didn't have time to check the combinations, but based on your JVM you may
also need to enable the following options:

-XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC

With these explicit calls, the permgen test that was posted in this
thread works
as expected, as class(loaders) are released and the permgen is GC-ed.

As anticipated, 6.x does not have this problem.
Davide




On 12/16/2013 03:27 AM, pmander wrote:
> Hi,
>
> You mention that the brand new kbase evertime could be a problem and you may
> get this from "re-deployments". In my situation I am not in an app server
> and so do not have a re-deployment issue but I am creating a new kbase every
> time I run through the system.
>
> The system dynamically creates the drl from database definitions and this is
> done for each "run" of the application. Is there an alternative for this?
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/permgen-leak-tp4027038p4027321.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list