Memory-Problemwith instance of "ReteooStatefulSession"
by anniejoseph
Hi,
I'm using jBoss Rules.But I run in to memory issues after using JBoss
rules. Using a profiling tool I collected heap dump
and I got the result as :
/One instance of "org.drools.reteoo.ReteooStatefulSession" loaded by
"sun.misc.Launcher$AppClassLoader @ 0x7f899fdb6d88" occupies 657,328,888
(78.91%) bytes.
The memory is accumulated in one instance of
"*org.drools.reteoo.ReteooStatefulSession*"
loaded by "sun.misc.Launcher$AppClassLoader @ 0x7f899fdb6d88".
Keywords
sun.misc.Launcher$AppClassLoader @ 0x7f899fdb6d88
org.drools.reteoo.ReteooStatefulSession/
The code I used for JBoss rules is given below.
kbase= KnowledgeBaseFactory.newKnowledgeBase();
ksession= kbase.newStatefulKnowledgeSession();
final String str =
CISMSRemotingUtils.getFullConfigFilePath("change-set.xml") ;
final String filePath = str.replaceAll(" ", "%20");
aconf = KnowledgeAgentFactory .newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.newInstance", "false");
kagent = KnowledgeAgentFactory.newKnowledgeAgent( "Agent", aconf);
kagent.applyChangeSet( ResourceFactory.newFileResource(filePath) );
kbase = kagent.getKnowledgeBase();
ksession= kbase.newStatefulKnowledgeSession();
sconf
=ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty( "drools.resource.scanner.interval", "3600");
ResourceFactory.getResourceChangeScannerService().configure( sconf );
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
This piece of code is given in the class constructor and rules are fired
inside this class
ksession.insert(data);
ksession.fireAllRules();
Can anyone help me to identify the problem?
--
View this message in context: http://drools.46999.n3.nabble.com/Memory-Problemwith-instance-of-ReteooSt...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
Drools Planner/Optaplanner suitability
by droolster
Hello,
Please can the community tell me if Drools Planner/Optaplanner is the best
tool to use for the problem described below:
1. For a list of items, I assign a point depending on the value of each
item. For different values of an item, I will assign a different point (kind
of on a rule basis i.e. if value = A, then assign 3 points, if value = B,
then assign 9 points etc)
2. I multiply the points assigned to each item by a weight.
3. I sum the total number of weighted points and divide by the sum of the
weights (basically, I compute the weight average).
Is Drools Planner the right tool to use here or is it better to use Drools
Expert?
>From looking at the Drools Planner documentation, it looks like an
optimisation tool and I am not really doing any optimising here. I am just
calculating a value based on some rules.
Regards.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Planner-Optaplanner-suitability-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
OptaPlanner: unsolved score & constraint failure messages
by Sandeep Bandela
Hi,
I have some experience with drools 5 and now experimenting on planner &
drools 6.
I have 'unsolved' PlanningSolution that could be given to a solver and it
successfully solves it. (its just the curriculum example with few more
variables like teachingAssistant, equipment etc)
I need to know few things about this unsolved solution.
1) I want to know the score of this unsolved before starting to solve it.
can I do this without instantiating my own drools session with my score
holder and execute the rules for score? i.e only using optaplanner-api and
not depend on underlying rules engine used by planner.
2) I also want to have some information on what all rules got fired in
calculation of score (the negative ones). to print the conflicting planning
entities & their variables. I could put a message from each rule to some
object in workingMem. but how can I get those objects back after the solver
is done but didnt have a feasible solution/ or even for any given solution.
or is there any better way?
--
Regards,
Sandeep Bandela.
11 years, 6 months
Strange behaviour when adding rules during run-time
by IK81
Dear all,
I am encountering a strange issue that rules fire based on events, which I
already considered as expired. As far as I learned from the documentation
Drools automatically determines the expiration time of an event based on
analyzing the rules (e.g. if there's a temporal operator or aggregation
using the event). Ok, i do not use anything of that. My scenario is as
follows - for testing purposes I use a pseudo session clock and of course
the STREAM mode.
- At time 0 I insert an Event A and call fireAllRules
- Then I advance the time for 100 seconds
- Now I add a further rule by parsing a drl file and adding it to the
Knowledge base of my current session
- Then, still at time 100 I insert another Event B and call fireAllRules
again
The rule that I've inserted previously fires but unfortunately twice. Once
for event A (which I already considered as expired) and for event B (which
is that what I wanted).
Even if i use the @expires annotation in my drl this does not work
correctly. Do I have to call another method to trigger the expiration in the
session. Any suggestions?
Ingo
p.s. I am using Drools 5.5 final
--
View this message in context: http://drools.46999.n3.nabble.com/Strange-behaviour-when-adding-rules-dur...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
Re: [rules-users] Convert GuidedDecisionTable to DRL
by learnbrms
Use http://<hostname>:<port>/jboss-brms/rest/packages/{packageName}/source to
get the DRL file source.
I guess GDST is like an excel sheet on top of which rules are written. So if
you are migrating it from one repo to another, you have to migrate this
asset as gdst but if you just need DRL, get it from package source.
You can get the source of GDST with
http://<hostname>:<port>/jboss-brms/rest/packages/{packageName}/assets/{assetName}/source
I will wait to see if someone corrects my thinking but you can try the REST
approach and it works fine.
Thanks,
SR
--
View this message in context: http://drools.46999.n3.nabble.com/Convert-GuidedDecisionTable-to-DRL-tp40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
OptaPlanner Guvnor integration
by Bartek
Hello,
How Optaplanner and Guvnor should be integrated? I am using Drools
5.5.0.Final. I have configuration with spring so I have access to
KnowledgeBase.
I found in documentation:
5.3.4.2.2. A RuleBase (possibly defined by Guvnor)
solverFactory.getSolverConfig().getScoreDirectorFactoryConfig.setRuleBase(ruleBase);
How I can get rule base? (If it is correct way do integrate with guvnor)
Thanks,
11 years, 6 months
Create KieBase from Jar/Zip
by Daniel Straub
If we create a KieBase from a Jar, all rules has to be placed in
"src/main/resources" (why ?).
That means, it is not possible to build a "jar" with maven, beacuse maven
puts all resouces in the root folder of fhe jar.
Ok, we build a "zip", using the maven assembly plugin.
But there is an error in
org.drools.compiler.compiler.io.memory.MemoryFileSystem :
This implementation expected every file is placed in a folder - that's true,
except the pom.xml.
But if we place the pom.xml in another folder (like META-INF), the pom isn't
found.
As workaround to this and the previous errors, we create now the
KieFileSystem itself :
--
View this message in context: http://drools.46999.n3.nabble.com/Create-KieBase-from-Jar-Zip-tp4024536.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months