Analysing OutOfMemory, too many RightTuple
by bvoisin
Hi all,
With my set of rules and data, I get OutOfMemory issues. It works fine with
smaller sets of Data.
Looking with a HeapDump analyzer, I found that there was thousands of
RightTuples. In a previous run, before some rules fixes, I also add tons of
JoinNodeLeftTuple's.
They seem to come from poorly written rules; unfortunately, I find it quite
difficult to find and correct the conditions/rules causing these tons of
RightTuple.
Is there any analysis option/tool that can give information on the Left Hand
Side (tuples and sinks), or is there any BestPractices on how to correct the
rules to limit this behavior?
I use Drools 6.1.0.Beta4, with Phreak enabled, but had similary issues with
6.0.0 or 6.0.1
Regards,
Benoît
--
View this message in context: http://drools.46999.n3.nabble.com/Analysing-OutOfMemory-too-many-RightTup...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 5 months
NullPointerException at org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion
by tia
Hello,
I'm trying to add a new rule on the fly like here:
https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test...
Here is the method to add a rule, once the KieSession is created and
configured:
public void addRule(String rule){
KieServices ks= KieServices.Factory.get();
ReleaseId rid= ks.newReleaseId("org.kie", "businessrules", "1.0");
KieFileSystem kfs = ks.newKieFileSystem();
kfs.generateAndWritePomXML(rid);
kfs.write("src/main/resources/rule.drl",rule);
KieBuilder kb = ks.newKieBuilder(kfs).buildAll();
if( kb.getResults().hasMessages( org.kie.api.builder.Message.Level.ERROR )
) {
for( org.kie.api.builder.Message result : kb.getResults().getMessages() )
{
System.err.println(result.getText());
}
}
InternalKieModule kieModule = (InternalKieModule) ks.getRepository()
.getKieModule(rid);
byte[] jar = kieModule.getBytes();
Resource jarRes = ks.getResources().newByteArrayResource(jar);
ks.getRepository().addKieModule(jarRes);
kieContainer.updateToVersion(rid);
}
But when I'm calling this method, I get the error below:
java.lang.NullPointerException
at org.drools.core.util.LinkedList.remove(LinkedList.java:168)
at
org.drools.core.phreak.AddRemoveRule.mergeSegment(AddRemoveRule.java:938)
at
org.drools.core.phreak.AddRemoveRule.correctSegmentOnSplitOnRemove(AddRemoveRule.java:377)
at org.drools.core.phreak.AddRemoveRule.removeRule(AddRemoveRule.java:182)
at
org.drools.core.reteoo.ReteooBuilder.removeTerminalNode(ReteooBuilder.java:171)
at org.drools.core.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:165)
at
org.drools.core.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:1406)
at
org.drools.core.reteoo.ReteooRuleBase.removeObjectsGeneratedFromResource(ReteooRuleBase.java:1652)
at
org.drools.compiler.compiler.PackageBuilder.removeObjectsGeneratedFromResource(PackageBuilder.java:3898)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:114)
For the line : "kieContainer.updateToVersion(rid);"
But if I'm firing the rules once (kieSession.fireAllRules();) before adding
the new rule, I don't get the exception O_o
Someone has any idea why ?
thanks!
--
View this message in context: http://drools.46999.n3.nabble.com/NullPointerException-at-org-drools-comp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 5 months
Adding eval on rule cause it to run in infinite loop
by brachi
for this Drools Fact Type:
/*
declare DvFacts0
@propertyReactive
IsNUMERIC: Double
condIsNUMERIC: Double
end*/
I have this rule:
/*rule "1"
salience -1
agenda-group "agenda1"
when
$condIsNUMERIC: DvFacts0(eval(condIsNUMERIC == null ) )
$conclusion: DvFacts0( )
then
modify($conclusion){setIsNUMERIC(1.0)};
end*/
the rule hit just one time without the eval clause, adding the eval cause
this rule to run in infinite loop.
have an idea?
put attention that I add @propertyReactive on the DVFacts0 to avoid this.
--
View this message in context: http://drools.46999.n3.nabble.com/Adding-eval-on-rule-cause-it-to-run-in-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 5 months
Drools Planner: Vehicle routing problems
by davidglassborow
Hi,
as discussed the other day with Ge0ffrey on IRC, I've been trying to
get some vehicle routing done using the new TSP / chaining functionality in
drools planner.
I've written an example, but am having problems with the chaining of jobs
together. After pulling my hair out, I've put together an example into my
fork of planner, showing a simplified example of how I am approaching it,
and the problem that can be replicated.
https://github.com/davidglassborow/drools-planner/tree/vehicle_routing
It is a very simple console app along the same lines as the hello world
example for NQueens.
On running it will print out the chains, and you will see the some Jobs
appear more than once in the same list.
On the planning variable it seems to be get assigned in front of itself,
I've put some notes in the source, and checked that the same doesn't occur
in your TSP example.
I'm not sure if its a bug in the way I've setup things, or whether its an
issue in the chain move code.
Greatly appreciated if anybody in the know gets a chance to have a look.
Thanks,
David
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Planner-Vehicle-routing-problems...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 5 months