Drools - Is there a direct correlation between number of rules and permgen space?

怎甘沉沦 提交于 2019-12-25 01:35:22

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/52086452/drools-is-there-a-direct-correlation-between-number-of-rules-and-permgen-space

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!