[rules-users] permgen leak

pmander paul.s.mander at gmail.com
Tue Dec 3 07:00:41 EST 2013


I've put together a test and running it through a few times shows that the
perm gen will actually recover but only if it is set at a level that is
double the initial value. Let me elaborate. 

In my test, I create a session, add the rules, the facts, query the results,
remove the facts and results and then repeat. Based on certain numbers of
rules and facts, this will use 350mb of perm gen no matter how many times I
repeat. Now if I run the whole test again which will dispose of the original
session and create a new one then I get perm gen errors if my max perm gen
is 512m. Looking at the perm gen graph in jconsole or similar shows that the
second session builds on the first perm gen and it fails without recovering.

If I now adjust the rules/facts so that I use 235mb then the second run
completes and the 3rd run causes GC in the perm gen. you can see this in
jconsole.

So, if you profile your app and see what the perm gen if initially, doubel
the max perm gen (and add a bit more) then you should be ok. 

However, if I change the dialect to "mvel" and then add drools.rulebase.conf
into META-INF with drools.permgenThreshold=0, then my permgen sits at 19mb
for the last test and does not increase when running it multiple times. 

Interestingly, it was stated in a previous through that mvel was less
performant but interestingly, the java dialect test took 179 seconds to
complete but the mvel one tool 112seconds.

This does appear to question the defaults in the application.



--
View this message in context: http://drools.46999.n3.nabble.com/permgen-leak-tp4027038p4027063.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list