Hi Mark,<br>Any news on this one? I know its just a puzzle, but I would have hoped drools would cope with it.<br>I was hoping to use the golfer example as a training aid to people in work.<br><br>Regards<br><br>Simon<br><br>
<div><span class="gmail_quote">On 09/08/07, <b class="gmail_sendername">Simon French</b> <<a href="mailto:french.simon@gmail.com">french.simon@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Mark,<br>I gave the latest version a go but still having the same problem.<br>It appears Drools doesn't like it when the last name is asserted into working memory.<br>The memory usage at this stage is just under 900meg.
<br>After that drools gradually eats up all the available memory but no more assertions are made.<br><br>Regards<br><span class="sg"><br>Simon</span><div><span class="e" id="q_1144b3c1648d0728_2"><br><br><br><div><span class="gmail_quote">
On 03/08/07, <b class="gmail_sendername">Mark Proctor
</b> <<a href="mailto:mproctor@codehaus.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mproctor@codehaus.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
I must admit I didn't check against this example. But we did find a
memory leak. Each activation remembers its parent activation, this
chain was never getting nulled, which meant for recursive algorithms it
went out of memory very quickly - this is now fixed. Maybe you can
check trunk and make sure that fixes our problem? Trunk is broken at
the moment, while we do MVEL updates, but should be fixed in a few
hours. I'll message the list when it is - you won't need to build
anything yourself as you will then be able to get the latest snapshot
to try from here
<a href="http://cruisecontrol.jboss.com/cc/artifacts/jboss-rules" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://cruisecontrol.jboss.com/cc/artifacts/jboss-rules</a>.<div><span>
<br>
<br>
Mark<br>
Simon French wrote:
<blockquote type="cite">Hi Mark,<br>
After all the hard work you guys have put into drools recently I hope
you had a good holiday.<br>
Has anybody had a chance to look at this?<br>
<br>
Simon<br>
<br>
<div><span class="gmail_quote">On 20/07/07, <b class="gmail_sendername">
Mark Proctor</b> <<a href="mailto:mproctor@codehaus.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mproctor@codehaus.org</a>>
wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">we'll look into this to see
where the memory is going. but won't be for
another week or so - I'm currently on holiday.<br>
<br>
Mark<br>
Simon French wrote:
<blockquote type="cite">
<div><span>Hi,<br>
After attending a session with Mark Proctor in London I was inspired to
play around with Drools in a slightly different way than we use it for
in the workplace, and try and solve a puzzle.<br>
Unfortunately I couldn't get Drools to solve it as I kept getting
memory problems (I believe are cartesian joins being the problem), <br>
so I decided to extend the golfer example to see if I got the same
problem<br>
I added two new names and a new integer property, club<br>
<br>
// create all possible Golfer objects<br>
String[] names = new String[] { "Fred", "Joe", "Bob",
"Tom", "Des", "Terry" }; <br>
String[] colors = new String[] { "red", "blue",
"plaid", "orange","black", "white" };<br>
int[] positions = new int[] { 1, 2, 3, 4, 5, 6 }; <br>
int[] clubs = new int[] {9,8,7,4,5,5};<br>
<br>
for ( int n = 0; n < names.length; n++ ) {<br>
for ( int c = 0; c < colors.length; c++ ) {<br>
for ( int p = 0; p < positions.length; p++
) {<br>
for ( int q = 0; q < clubs.length; q++
) {<br>
session.insert(new Golfer( names[n],
colors[c], positions[p], clubs[q]) );<br>
<br>
....<br>
<br>
<br>
Then changed the golder.drl to:<br>
<br>
package com.sample<br>
<br>
import com.sample.Golfer;<br>
<br>
<br>
rule "Golfer Riddle" <br>
when<br>
// A golfer named Fred, <br>
<br>
Golfer( name == "Fred", <br>
$fredsPosition : position, $fredsColor : color,
$fredsClub : club )<br>
<br>
// Der Golfer hinter Fred trägt blau<br>
Golfer( $unknownsName : name != "Fred", <br>
$unknownsPosition : position == ( $fredsPosition + 1
), <br>
$unknownsColor : color == "blue", color != $fredsColor,<br>
$unknownsClub : club == 5 )<br>
<br>
// Joe steht an zweiter Stelle <br>
Golfer( name == "Joe", $joesPosition : position == 2, <br>
position != $fredsPosition,<br>
$joesColor : color != $fredsColor,<br>
$joesClub : club == 5 )<br>
<br>
// Bob traegt Karo <br>
Golfer( name == "Bob", <br>
name != $unknownsName,<br>
$bobsPosition : position != $fredsPosition,<br>
position != $unknownsPosition, position !=
$joesPosition, <br>
$bobsColor : color == "plaid",<br>
color != $fredsColor, color != $joesColor,<br>
color != $unknownsColor, <br>
$bobsClub : club < $joesClub )<br>
<br>
// Tom ist nicht 1. oder 4., traegt kein Orange<br>
Golfer( $tomsName : name == "Tom", <br>
$tomsPosition : position != 1, position != 4,<br>
position != $fredsPosition, position != $joesPosition, <br>
position !=
$bobsPosition, <br>
$tomsColor : color != "orange", color != "blue",<br>
color != $fredsColor, color != $joesColor, <br>
color != $bobsColor ) <br>
<br>
Golfer ( $des : name == "Des", $desPosition : position <
$fredsPosition, $desColor : color != "blue",<br>
color != $fredsColor, color != $joesColor, <br>
color != $bobsColor )<br>
Golfer ( $terry : name == "Terry", $terryPosition : position
< $desPosition, $terryColor : color != "blue",<br>
color != $fredsColor, color != $joesColor, <br>
color != $bobsColor )<br>
then<br>
System.out.println( "Fred " + $fredsPosition + " " +
$fredsColor );<br>
System.out.println( "Joe " + $joesPosition + " " + $joesColor
); <br>
System.out.println( "Bob " + $bobsPosition + " " + $bobsColor );<br>
System.out.println( "Tom " + $tomsPosition + " " + $tomsColor
); <br>
System.out.println
( "Des " + $desPosition + " " + $desColor ); <br>
System.out.println( "terry " + $terryPosition + " " +
$terryColor ); <br>
end <br>
<br>
<br>
After a couple of minutes of processing I got:- <br>
<br>
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space<br>
<br>
I also changed java memory allocation with -Xms1640M -Xmx1640M (The
most I can allocate on my PC), and tried running it as a stateless
session too. <br>
<br>
Is there anything else I can do, or is this simply pushing drools too
far (surely not!!) ?<br>
<br>
I'm very keen on pushing this technology as much as possible in our
workplace and I'd really appreciate any help. <br>
<br>
Thanks in advance<br>
<br>
Simon<br>
<br>
</span></div>
<pre><hr size="4" width="90%">
_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org
<br><br></a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</div>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
</blockquote>
</div>
<br>
<pre><hr size="4" width="90%">
_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org
<br></a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</span></div></div>
<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org
</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div><br>
</span></div></blockquote></div><br>