Out of memory error in drools

2019-05-14 20:31发布

问题:

I am using drools5.5 and creating knowledge bases with the required drls and decision tables to execute the rules. In that., when i try to load a decision table(which is a XLS that has nearly 20,000 lines) in knowledgeBuilder i am getting out of memory exception.I have used the following piece of code

KnowledgeBuilder knowBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
knowBuilder.add(ResourceFactory.newFileResource(fileLocation),ResourceType.determineResourceType(fileLocation));

when i execute this., i am getting Java heap space error and permGen space error. Is there any other way to load the large sized rulefiles in drools efficiently.

回答1:

The question is how big is the XLS file in memory and how many objects are being created? Are you inserting facts into the session? What is your heap size?