Drools - Is there a direct correlation between num

2019-08-17 19:37发布

I ran drools decision table with 100 rules and it worked fine. But as soon as I increased the number of rules to 1000, I started getting permgen space error. I had to increase permgen to 256MB for my process to accommodate the 3000 rules. My concern is as I keep adding the rules, I might need more and more permgen.

I am thinking of not using drools and develop a custom solution due to this issue.

Is this correct observation or am I doing something wrong causing the perm gen space requirement to increase

2条回答
萌系小妹纸
2楼-- · 2019-08-17 20:28

Yes we are aware of this problem https://issues.jboss.org/browse/RHDM-488

查看更多
唯我独甜
3楼-- · 2019-08-17 20:35

From the below link it seems we can disable the permgenThreshold for Java 7 though it will negatively impact the rule evaluation performance.

https://issues.jboss.org/browse/DROOLS-1016?focusedCommentId=13144411&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13144411

The increased requirement in term of the occupied permgen space is not caused by the new phreak algorithm, but mainly by the fact that in drools 6 constraints are jitted, i.e. converted in bytecode and then evaluated in compiled mode instead of keep using mvel for each evaluation. You can have finer grained control over the permgen space used by drools setting the "drools.permgenThreshold" system property. This property represents the threshold of PermGen usage (in percentage) above which the engine stops JITting constraints and let them run in interpreted mode. In particular setting this property to 0 will completely turn off this optimization, but I don't suggest you to do so because the performance gain derived from evaluating the constraints in compiled mode is really relevant. My suggestion, at least on the long term, is to migrate to JDK 8 that no longer has a PermGen space separated from the normal heap space.

查看更多
登录 后发表回答