Drools memory issue
by Sateesh Hegde
Hi Team,
We are using drools 5.2 and here is the memory foot print. This is
the steady state memory after 3 days of testing. We are keeping the
fact in WM and I am fine with the memory consumption from facts.
However I am not able to understand this RightTuple of type
HashMapEntry, and it looks like a leak suspect.
Any help pointer to figure out what are these RightTuple and I also
suspect it is grwoing over a period of time, though my fact count
remain fairly constant.
Thanks and Regards
--
Sateesh Hegde
12 years, 2 months
Ignoring PatternSyntaxException in decison tables
by DOLECEK Ales
Hello,
we have provided users with option to edit some of the rules in Excel table. One of the CONDITIONs uses "matches" operator and the pattern is in the spreadsheet. Users have entered wrong regular expression which, when compiled using Pattern.compile(), throws PatternSyntaxException.
The rules defined in the Excel table are however loaded and merged into the knowledgebase without problems. At runtime during evaluation no error is thrown.
My question is: Is there a way to find out wrong regular expression on the RHS of matches operator during knowledgebase creation?
Ales
12 years, 2 months
What is the side-effect of using the CE "from"?
by Sonata
Hi, I remember seeing some best practice and since then it has been in my
mind that the Drools team actually against the use of CE "from". I do
however find it really useful and use it alot (and in fact everywhere).
Could the Drools team clear this up?
For example, I found it useful because
1. When a fact is inserted into the working memory, "from" conditions are
not evaluated.
This is good because the fact may not be ready yet (e.g. need updating to
fill in more stuff to complete it in some rules) and evaluating the fact too
early may cause exceptions. Using "from" does not suffer from this issue.
2. Also, this is good because I dont get unnecessary calls to getters of
that newly inserted fact for all the rules in the kbase with the class of
that fact in the LHS because they may not be triggered at the end (e.g.
filtered by agenda-groups, activation-groups). I put auditing codes on my
getters to track usage and profiling, hence each call to getters is quite
expensive for me (elapse time recording, database updating, etc.)
3. Once a preceding "from" condition fails, all the subsequent "from"
conditions will not be evaluated. Again, this is good to save unnecessary
member accesses to boost performance.
I know what I dont get using "from" is same pattern node sharing (i.e. same
condition pattern across rules is evaluated only once when "from" is not
used), but it seems to me that the pros outweigh the cons.
Thanks the Drools team for clarifying
--
View this message in context: http://drools.46999.n3.nabble.com/What-is-the-side-effect-of-using-the-CE...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months
session deserialization slidingTimeWindow NPE
by Alexander Wolf
Sometimes (I am not sure what the actual reason is yet ) I get following NPE when I try to deserialize my ksessions:
java.lang.NullPointerException
at org.drools.common.ConcurrentNodeMemories.getNodeMemory(ConcurrentNodeMemories.java:63)
at org.drools.common.AbstractWorkingMemory.getNodeMemory(AbstractWorkingMemory.java:1034)
at org.drools.rule.SlidingTimeWindow$BehaviorExpireWMAction.<init>(SlidingTimeWindow.java:460)
This is not a new problem, I found an old post on the mailing list, that describes the same here: (but unfortunately without any answers)
http://drools.46999.n3.nabble.com/rules-users-5-5-0-Final-persistence-to-...
Apparently it's got something to do with slidingTime in one rule, but as it does not always occur - am I quite puzzled.
Any Ideas or Workarounds?
- Alex
12 years, 2 months
why define the returnedProcessor twice
by scarlettxu
Hi Expert,
I am a new guy to drools rules and studying the drools camel server now.
And I see in the DroolsPolicy class located in project
drools-camel-5.2.0.Final , it define the returnedProcessor twice
public Processor wrap(RouteContext routeContext, Processor processor)
{
RouteDefinition routeDef = routeContext.getRoute();
ToDefinition toDrools = getDroolsNode(routeDef);
* Processor returnedProcessor;
Processor returnedProcessor;*
if (toDrools != null) {
returnedProcessor = new DroolsProcess(toDrools.getUri(), processor);
}
else {
returnedProcessor = processor;
}
return returnedProcessor;
}
I wonder is it for special purpose ?
As I checked from version 5.2.0 Final to 6.0.0RC3
--
View this message in context: http://drools.46999.n3.nabble.com/why-define-the-returnedProcessor-twice-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months
Ascending sort by salience results in NPE
by Wolfgang Laun
rule "process Token"
salience - $prio // by ascending x25No values
when
$token: Token( $x25No: x25No ) // match on int x25No
$elem: ElemType( $prio: x25No == $x25No )
then
retract($token);
end
All versions 5.[2345].0 crash. Using "0 - $prio" is a workaround.
Exception in thread "main" java.lang.NullPointerException
at org.drools.base.mvel.MVELSalienceExpression.getValue(MVELSalienceExpression.java:93)
at org.drools.common.DefaultAgenda.createActivation(DefaultAgenda.java:579)
at org.drools.reteoo.RuleTerminalNode.assertLeftTuple(RuleTerminalNode.java:253)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:71)
at org.drools.reteoo.JoinNode.propagateFromLeft(JoinNode.java:107)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:95)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:145)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:154)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at geninq.Main.execute(Main.java:97)
at geninq.Main.main(Main.java:133)
12 years, 2 months
Why disable properyreactive if amount of properties larger than or equals to 64
by richie
In this code drools-compiler / src / main / java / org / drools / compiler /
compiler / PackageBuilder.java (Line 2515):
private void setPropertyReactive(Resource resource, TypeDeclaration
type, boolean propertyReactive) {
*if ( propertyReactive && type.getSettableProperties().size() >= 64
) {*
this.results.add( new DisabledPropertyReactiveWarning( resource,
type.getTypeName() ) );
*type.setPropertyReactive( false );*
} else {
type.setPropertyReactive( propertyReactive );
}
}
As we can see, if amount of properties is larger than or equals to 64, will
disable the property active, why? Is there any special reason?
--
View this message in context: http://drools.46999.n3.nabble.com/Why-disable-properyreactive-if-amount-o...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months
Drools Fusion, best practise?!
by Alexander Wolf
Hey,
I try to use drools fusion to detect patterns in an event stream.
Each time an event occurs I insert it into my ksession and call fireAllRules().
Most of my rules need to reason over the newest event (the one that just came in) in conjunction with events that happend before or after that.
I also have a "state" within my environment. e.g. temperature (HIGH, MEDIUM, LOW). (but also other state variables)
e.g. [pseudo code]
WHEN
temperature MEDIUM or LOW
newest event (value >= 20)
last previous event (value >= 20)
then
set temperature to HIGH
Now I run into lots of problems with this e.g. that I can not easily get the "newest" and "last previous" events. When i get Events() there is usually more than one (as some of them are not immediately expired)
Also the rule is triggert when temperature is changed without a new event being inserted.
I could theoretically "mark" events that have been used, but I might run into problems when other rules are added that depend on the same events. Also it seems to be untidy to do so.
For now I used this to get the "newest" event, but it seems to be very non-declarative to do it like that
//most recent event
Stack(size > 0, $event: pop, $event.value == 1)
from collect( Event())
Are there any best practices especially for working with the "newest" event and with events + facts (as "states")?
- Alex
12 years, 2 months