[rules-users] Reading DRL file with large number of rules

Wolfgang Laun wolfgang.laun at gmail.com
Sat Feb 6 08:55:47 EST 2010


Have you tried increasing the heap size for the JVM?

"20K rules [of the same] simple form" sounds as if you are
trying to use a hammer where a screwdriver would be appropriate.
If your description is correct, these 20K rules would be nothing
but 20K if statements, in disguised form. There is nothing
in that which would gain from Drools' Rete algorithm with
its superior "many-patterns-many-object" matching capabilities.

-W

On Sat, Feb 6, 2010 at 12:42 PM, kpowerinfinity
<kpowerinfinity at gmail.com> wrote:
> Hello,
>
> We are trying to run a DRL file that has more than 20K rules, all of
> which have the simple form:
>
>
>
> rule "testpeoplenumber"
>        salience 100
>        dialect "mvel"
>        when
>                LineItem( inventoryItemCode == "8903210392090")
> then
>                InventoryItem fact0 = new InventoryItem();
>                fact0.setCategoryCode( "ONPROMO" );
>                insert(fact0 );
> end
>
> However, the rule file is not getting parsed by the builder, and
> either takes a very long time (well over half an hour), or gives a
> Heap Overflow exception. We tried with a smaller file (about 1K rules,
> and the situation is the same).
>
> The parsing code is:
> org.drools.KnowledgeBaseConfiguration kbc =
> org.drools.KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null,
> cl);
>            org.drools.KnowledgeBase kbase =
> org.drools.KnowledgeBaseFactory.newKnowledgeBase(kbc);
>                org.drools.builder.KnowledgeBuilderConfiguration
> knowledgeBuilderConfig =
> org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null,
> cl);
>            org.drools.builder.KnowledgeBuilder builder =
> org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(kbase,
> knowledgeBuilderConfig);
>            org.drools.builder.impl.KnowledgeBuilderImpl builderImpl =
> builder as org.drools.builder.impl.KnowledgeBuilderImpl;
>
>            builder.add(org.drools.io.ResourceFactory.newFileResource(filename),
>                    org.drools.builder.ResourceType.DRL);
>
> We are using Drools v5. We've tried both with the java jar as well as
> in .NET (using IKVM to compile it).
>
> Any help in understanding why this is happening and how it can be
> avoided will be appreciated.
>
> Warm Regards
> Krishna.
>
> --
> http://kpowerinfinity.wordpress.com
> http://www.linkedin.com/in/kpowerinfinity
> _______________________________________________
> 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