JESS: static members in Jess 7.1

View: New views
15 Messages — Rating Filter:   Alert me  

JESS: static members in Jess 7.1

by erich.oliphant :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I'm helping a client that's currently on a very old Jess 7.0 (b2 I
believe) upgrade to the 7.1p2 version.  The existing jess code imports
some 'constructed' pre- Java 1.5 enums of the form

public class MyEnum {

    public final static ENUMVAL1 = new MyEnum(..);
}

In the 7.0b Jess code we were able to (import) the MyEnum and
reference ENUMVAL1 in expressions like:
...
exists (com.somepkg.SomeClass
            {myEnum  != MyEnum.ENUMVAL1})
..

Jess 7.1 is not happy about this and reports "Message: Variable used
before definition: MyEnum."

Just want to verify based on my reading of the latest docs but it
seems that this:

{myEnum  != MyEnum.ENUMVAL1}

should be replaced with something like this:

{myEnum  != (get-member MyEnum ENUMVAL1)}

Is this the correct way to address this ?

Thanks In Advance,
Erich


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: static members in Jess 7.1

by Ernest Friedman-Hill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Erich,

I have some bad news for your client: this syntax

>  {myEnum  != MyEnum.ENUMVAL1}

NEVER worked. The test they've written is comparing the myEnum slot to  
the Jess symbol "MyEnum.ENUMVAL1", which, although it wouldn't give an  
error, also never did the right thing. This stopped working because  
dots in variables because significant, and there it, actually, a dot  
notation you can use, although not quite in this context.

Your get-member workaround will work fine, but there are some somewhat  
nicer looking alternatives: either this

http://www.jessrules.com/jesswiki/view?EnumeratedTypes

or the even fancier

http://www.jessrules.com/jesswiki/view?BindEnumUserFunction

depending on how involved the enums are.

On Sep 2, 2009, at 12:05 PM, erich oliphant wrote:

> Hi,
> I'm helping a client that's currently on a very old Jess 7.0 (b2 I
> believe) upgrade to the 7.1p2 version.  The existing jess code imports
> some 'constructed' pre- Java 1.5 enums of the form
>
> public class MyEnum {
>
>    public final static ENUMVAL1 = new MyEnum(..);
> }
>
> In the 7.0b Jess code we were able to (import) the MyEnum and
> reference ENUMVAL1 in expressions like:
> ...
> exists (com.somepkg.SomeClass
>            {myEnum  != MyEnum.ENUMVAL1})
> ..
>
> Jess 7.1 is not happy about this and reports "Message: Variable used
> before definition: MyEnum."
>
> Just want to verify based on my reading of the latest docs but it
> seems that this:
>
> {myEnum  != MyEnum.ENUMVAL1}
>
> should be replaced with something like this:
>
> {myEnum  != (get-member MyEnum ENUMVAL1)}
>
> Is this the correct way to address this ?
>
> Thanks In Advance,
> Erich
>
>
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users  
> you@...'
> in the BODY of a message to majordomo@..., NOT to the list
> (use your own address!) List problems? Notify owner-jess-users@...
> .
> --------------------------------------------------------------------

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs
PO Box 969, MS 9012                            ejfried@...
Livermore, CA 94550                             http://www.jessrules.com





--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: static members in Jess 7.1

by erich.oliphant :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Awesome thanks for the quick response

On Wed, Sep 2, 2009 at 1:29 PM, Ernest Friedman-Hill<ejfried@...> wrote:

> Hi Erich,
>
> I have some bad news for your client: this syntax
>
>>  {myEnum  != MyEnum.ENUMVAL1}
>
> NEVER worked. The test they've written is comparing the myEnum slot to the
> Jess symbol "MyEnum.ENUMVAL1", which, although it wouldn't give an error,
> also never did the right thing. This stopped working because dots in
> variables because significant, and there it, actually, a dot notation you
> can use, although not quite in this context.
>
> Your get-member workaround will work fine, but there are some somewhat nicer
> looking alternatives: either this
>
> http://www.jessrules.com/jesswiki/view?EnumeratedTypes
>
> or the even fancier
>
> http://www.jessrules.com/jesswiki/view?BindEnumUserFunction
>
> depending on how involved the enums are.
>
> On Sep 2, 2009, at 12:05 PM, erich oliphant wrote:
>
>> Hi,
>> I'm helping a client that's currently on a very old Jess 7.0 (b2 I
>> believe) upgrade to the 7.1p2 version.  The existing jess code imports
>> some 'constructed' pre- Java 1.5 enums of the form
>>
>> public class MyEnum {
>>
>>   public final static ENUMVAL1 = new MyEnum(..);
>> }
>>
>> In the 7.0b Jess code we were able to (import) the MyEnum and
>> reference ENUMVAL1 in expressions like:
>> ...
>> exists (com.somepkg.SomeClass
>>           {myEnum  != MyEnum.ENUMVAL1})
>> ..
>>
>> Jess 7.1 is not happy about this and reports "Message: Variable used
>> before definition: MyEnum."
>>
>> Just want to verify based on my reading of the latest docs but it
>> seems that this:
>>
>> {myEnum  != MyEnum.ENUMVAL1}
>>
>> should be replaced with something like this:
>>
>> {myEnum  != (get-member MyEnum ENUMVAL1)}
>>
>> Is this the correct way to address this ?
>>
>> Thanks In Advance,
>> Erich
>>
>>
>> --------------------------------------------------------------------
>> To unsubscribe, send the words 'unsubscribe jess-users you@...'
>> in the BODY of a message to majordomo@..., NOT to the list
>> (use your own address!) List problems? Notify owner-jess-users@....
>> --------------------------------------------------------------------
>
> ---------------------------------------------------------
> Ernest Friedman-Hill
> Informatics & Decision Sciences          Phone: (925) 294-2154
> Sandia National Labs
> PO Box 969, MS 9012                            ejfried@...
> Livermore, CA 94550                             http://www.jessrules.com
>
>
>
>
>
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users you@...'
> in the BODY of a message to majordomo@..., NOT to the list
> (use your own address!) List problems? Notify owner-jess-users@...
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


JESS: strings versus symbols in facts

by jo-48 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I have a large quantity of facts to be matched against a rulebase.

Currently the facts use symbols everywhere but it is causing a headache as some symbols like : cause jess parser exceptions and need special treatment.  Strings would solve this but then I wonder if that would not cause a performance hit. ie the question is how does symbol versus string matching compare performance wise in rete?

tx
Joe


     


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: strings versus symbols in facts

by Ernest Friedman-Hill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As far as the fundamental types go, there's virtually no difference;  
for the most part, they use the same code. There is one difference:  
symbols are cached in the "ValueFactory", and cached symbols are  
likely to do raw equality comparisons a tiny bit faster. Also it's  
possible that you'll use less memory with symbols, as duplication will  
be reduced. On the other hand, the overhead of cache lookup is a small  
performance hit, of course, so in some cases symbols could conceivably  
be slower.

Overall, it's a wash. I don't think you'll see much of a difference  
either way.


On Sep 3, 2009, at 5:23 AM, jo wrote:

> Hi
>
> I have a large quantity of facts to be matched against a rulebase.
>
> Currently the facts use symbols everywhere but it is causing a  
> headache as some symbols like : cause jess parser exceptions and  
> need special treatment.  Strings would solve this but then I wonder  
> if that would not cause a performance hit. ie the question is how  
> does symbol versus string matching compare performance wise in rete?
>
> tx
> Joe

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


JESS: regular expressions page down on jessrules

by jo-48 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


on page
http://www.jessrules.com/jesswiki/view?JessSnippets
i click the link for UsingRegularExpressions
http://www.jessrules.com/jesswiki/view?UsingRegularExpressions

and I get:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException
    java.io.StringReader.<init>(StringReader.java:33)
    com.efsol.friki.HTMLRenderer.convert(HTMLRenderer.java:35)
    com.efsol.friki.HTMLRenderer.render(HTMLRenderer.java:75)
    com.efsol.friki.Model.render(Model.java:322)
    com.efsol.friki.FrikiServlet.show(FrikiServlet.java:282)
    com.efsol.friki.FrikiServlet.doQueryRequest(FrikiServlet.java:371)
    com.efsol.friki.FrikiServlet.doGet(FrikiServlet.java:464)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
Apache Tomcat/5.5.9


     


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: regular expressions page down on jessrules

by Ernest Friedman-Hill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Don't worry about it -- there's actually no such page, and the error  
is an unfortunate side effect of the Wiki being marked read-only at  
this time.
On Sep 8, 2009, at 11:45 AM, jo wrote:

>
> on page
> http://www.jessrules.com/jesswiki/view?JessSnippets
> i click the link for UsingRegularExpressions
> http://www.jessrules.com/jesswiki/view?UsingRegularExpressions
>
> and I get:
>
> HTTP Status 500 -
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that  
> prevented it from fulfilling this request.
>
> exception
>
> java.lang.NullPointerException
>    java.io.StringReader.<init>(StringReader.java:33)
>    com.efsol.friki.HTMLRenderer.convert(HTMLRenderer.java:35)
>    com.efsol.friki.HTMLRenderer.render(HTMLRenderer.java:75)
>    com.efsol.friki.Model.render(Model.java:322)
>    com.efsol.friki.FrikiServlet.show(FrikiServlet.java:282)
>    com.efsol.friki.FrikiServlet.doQueryRequest(FrikiServlet.java:371)
>    com.efsol.friki.FrikiServlet.doGet(FrikiServlet.java:464)
>    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
> note The full stack trace of the root cause is available in the  
> Apache Tomcat/5.5.9 logs.
> Apache Tomcat/5.5.9
>
>
>
>
>
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users  
> you@...'
> in the BODY of a message to majordomo@..., NOT to the list
> (use your own address!) List problems? Notify owner-jess-users@...
> .
> --------------------------------------------------------------------

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


JESS: Is it possible to redirect output of facts command to a file for post mortem investigation purposes ?

by jo-48 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi

Is it possible to redirect output of facts command to a file for post mortem investigation purposes ? This without redirect of the output of other commands in the same script.

Thanks In Advance,
Joe


     


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: Is it possible to redirect output of facts command to a file for post mortem investigation purposes ?

by Ernest Friedman-Hill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 11, 2009, at 9:07 AM, jo wrote:

>
> Is it possible to redirect output of facts command to a file for  
> post mortem investigation purposes ? This without redirect of the  
> output of other commands in the same script.



You could use the "save-facts" function to save facts to a file.


---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


JESS: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

by jo-48 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I got following error, which surprises me as I try to keep the amount of facts to a minimum.

Can I detect this condition *before* it is about to happen ? Any ideas on how to prevent this ?  

30m is really not that long :(

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at jess.factory.FactoryImpl.newToken(FactoryImpl.java:27)
        at jess.Node2.tokenMatchesLeft(Node2.java:326)
        at jess.Node2.doRunTestsVaryRight(Node2.java:314)
        at jess.Node2.doRunTestsVaryRight(Node2.java:299)
        at jess.Node2.runTestsVaryRight(Node2.java:292)
        at jess.Node2.callNodeLeft(Node2.java:156)
        at jess.NodeJoin.passAlong(NodeJoin.java:99)
        at jess.Node2.tokenMatchesLeft(Node2.java:328)
        at jess.Node2.doRunTestsVaryRight(Node2.java:314)
        at jess.Node2.doRunTestsVaryRight(Node2.java:299)
        at jess.Node2.runTestsVaryRight(Node2.java:292)
        at jess.Node2.callNodeLeft(Node2.java:156)
        at jess.NodeJoin.passAlong(NodeJoin.java:99)
        at jess.Node2.tokenMatchesLeft(Node2.java:328)
        at jess.Node2.doRunTestsVaryRight(Node2.java:314)
        at jess.Node2.doRunTestsVaryRight(Node2.java:299)
        at jess.Node2.runTestsVaryRight(Node2.java:292)
        at jess.Node2.callNodeLeft(Node2.java:156)
        at jess.Node1RTL.passAlong(Node1RTL.java:46)
        at jess.Node1RTL.callNodeRight(Node1RTL.java:28)
        at jess.Node1.passAlong(Node1.java:49)
        at jess.Node1MTELN.callNodeRight(Node1MTELN.java:35)
        at jess.Node1.passAlong(Node1.java:49)
        at jess.Node1TECT.callNodeRight(Node1TECT.java:40)
        at jess.NodeRoot.passAlong(NodeRoot.java:39)
        at jess.NodeRoot.callNodeRight(NodeRoot.java:14)
        at jess.FactList.processToken(FactList.java:31)
        at jess.FactList._assert(FactList.java:210)
        at jess.FactList.assertFact(FactList.java:181)
        at jess.Rete.assertFact(Rete.java:548)
        at jess.FactFunctions$Assert.call(FactFunctions.java:50)
        at jess.FunctionHolder.call(FunctionHolder.java:35)

real    30m12.867s
user    27m48.316s




tx
J


     


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

by Peter Lin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the simplest solution is to start JESS with the appropriate heap settings

-Xms256m -Xmx1024m

the default heap in java is 64mb

peter

On Mon, Sep 14, 2009 at 9:42 AM, jo <etaoinbe@...> wrote:

> Hi
>
> I got following error, which surprises me as I try to keep the amount of facts to a minimum.
>
> Can I detect this condition *before* it is about to happen ? Any ideas on how to prevent this ?
>
> 30m is really not that long :(
>
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>        at jess.factory.FactoryImpl.newToken(FactoryImpl.java:27)
>        at jess.Node2.tokenMatchesLeft(Node2.java:326)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:314)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:299)
>        at jess.Node2.runTestsVaryRight(Node2.java:292)
>        at jess.Node2.callNodeLeft(Node2.java:156)
>        at jess.NodeJoin.passAlong(NodeJoin.java:99)
>        at jess.Node2.tokenMatchesLeft(Node2.java:328)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:314)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:299)
>        at jess.Node2.runTestsVaryRight(Node2.java:292)
>        at jess.Node2.callNodeLeft(Node2.java:156)
>        at jess.NodeJoin.passAlong(NodeJoin.java:99)
>        at jess.Node2.tokenMatchesLeft(Node2.java:328)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:314)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:299)
>        at jess.Node2.runTestsVaryRight(Node2.java:292)
>        at jess.Node2.callNodeLeft(Node2.java:156)
>        at jess.Node1RTL.passAlong(Node1RTL.java:46)
>        at jess.Node1RTL.callNodeRight(Node1RTL.java:28)
>        at jess.Node1.passAlong(Node1.java:49)
>        at jess.Node1MTELN.callNodeRight(Node1MTELN.java:35)
>        at jess.Node1.passAlong(Node1.java:49)
>        at jess.Node1TECT.callNodeRight(Node1TECT.java:40)
>        at jess.NodeRoot.passAlong(NodeRoot.java:39)
>        at jess.NodeRoot.callNodeRight(NodeRoot.java:14)
>        at jess.FactList.processToken(FactList.java:31)
>        at jess.FactList._assert(FactList.java:210)
>        at jess.FactList.assertFact(FactList.java:181)
>        at jess.Rete.assertFact(Rete.java:548)
>        at jess.FactFunctions$Assert.call(FactFunctions.java:50)
>        at jess.FunctionHolder.call(FunctionHolder.java:35)
>
> real    30m12.867s
> user    27m48.316s
>
>
>
>
> tx
> J
>
>
>
>
>
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users you@...'
> in the BODY of a message to majordomo@..., NOT to the list
> (use your own address!) List problems? Notify owner-jess-users@...
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

by Ernest Friedman-Hill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Often memory use has nothing to do with how many facts or rules you  
have, but on the structure of the Rete network you've built with your  
rules, and in particular, how many partial matches it generates. Have  
a look at these links to get an idea of what to look out for:

http://www.jessrules.com/jess/FAQ.shtml#Q12
http://www.jessrules.com/jess/docs/71/rete.html#efficiency




On Sep 14, 2009, at 9:42 AM, jo wrote:

> Hi
>
> I got following error, which surprises me as I try to keep the  
> amount of facts to a minimum.
>
> Can I detect this condition *before* it is about to happen ? Any  
> ideas on how to prevent this ?
>
> 30m is really not that long :(
>
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>        at jess.factory.FactoryImpl.newToken(FactoryImpl.java:27)
>        at jess.Node2.tokenMatchesLeft(Node2.java:326)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:314)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:299)
>        at jess.Node2.runTestsVaryRight(Node2.java:292)
>        at jess.Node2.callNodeLeft(Node2.java:156)
>        at jess.NodeJoin.passAlong(NodeJoin.java:99)
>        at jess.Node2.tokenMatchesLeft(Node2.java:328)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:314)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:299)
>        at jess.Node2.runTestsVaryRight(Node2.java:292)
>        at jess.Node2.callNodeLeft(Node2.java:156)
>        at jess.NodeJoin.passAlong(NodeJoin.java:99)
>        at jess.Node2.tokenMatchesLeft(Node2.java:328)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:314)
>        at jess.Node2.doRunTestsVaryRight(Node2.java:299)
>        at jess.Node2.runTestsVaryRight(Node2.java:292)
>        at jess.Node2.callNodeLeft(Node2.java:156)
>        at jess.Node1RTL.passAlong(Node1RTL.java:46)
>        at jess.Node1RTL.callNodeRight(Node1RTL.java:28)
>        at jess.Node1.passAlong(Node1.java:49)
>        at jess.Node1MTELN.callNodeRight(Node1MTELN.java:35)
>        at jess.Node1.passAlong(Node1.java:49)
>        at jess.Node1TECT.callNodeRight(Node1TECT.java:40)
>        at jess.NodeRoot.passAlong(NodeRoot.java:39)
>        at jess.NodeRoot.callNodeRight(NodeRoot.java:14)
>        at jess.FactList.processToken(FactList.java:31)
>        at jess.FactList._assert(FactList.java:210)
>        at jess.FactList.assertFact(FactList.java:181)
>        at jess.Rete.assertFact(Rete.java:548)
>        at jess.FactFunctions$Assert.call(FactFunctions.java:50)
>        at jess.FunctionHolder.call(FunctionHolder.java:35)
>
> real    30m12.867s
> user    27m48.316s
>
>
>
>
> tx
> J
>
>
>
>
>
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users  
> you@...'
> in the BODY of a message to majordomo@..., NOT to the list
> (use your own address!) List problems? Notify owner-jess-users@...
> .
> --------------------------------------------------------------------

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

by James Owen-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Just one more thought - if your rules are taking 30 MINUTES rather than 30 seconds then it sounds like you have some kind of loop going on that is building (adding to) memory over and over and over.  The Miss Manners benchmark does this intentionally to "stress" the rule engine and, in particular, the Agenda matching table, to see if the engine can handle overloads such as this.

Check to see which rule is firing the most and you will probably find your problem child somewhere in that general area.  

SDG
James Owen
Founder October Rules Fest
Senior Consultant / Architect KBSC
Twitter: OctRulesFest
Blogs:
http://JavaRules.blogspot.com [Rulebased Systems Blog]
http://ORF2009.blogspot.com [October Rules Fest Blog]
http://exscg.blogspot.com/ [Expert Systems Consulting Group Blog]

"If I have seen a little further it is by standing on the shoulders of giants."
Sir Isaac Newton in a letter to Robert Hooke, 5 Feb 1676

Come to October Rules Fest and stand on the shoulders of the Giants of the industry; if only for a week.



On Sep 14, 2009, at 8:42 AM, jo wrote:

Hi

I got following error, which surprises me as I try to keep the amount of facts to a minimum.

Can I detect this condition *before* it is about to happen ? Any ideas on how to prevent this ?  

30m is really not that long :(

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
       at jess.factory.FactoryImpl.newToken(FactoryImpl.java:27)
       at jess.Node2.tokenMatchesLeft(Node2.java:326)
       at jess.Node2.doRunTestsVaryRight(Node2.java:314)
       at jess.Node2.doRunTestsVaryRight(Node2.java:299)
       at jess.Node2.runTestsVaryRight(Node2.java:292)
       at jess.Node2.callNodeLeft(Node2.java:156)
       at jess.NodeJoin.passAlong(NodeJoin.java:99)
       at jess.Node2.tokenMatchesLeft(Node2.java:328)
       at jess.Node2.doRunTestsVaryRight(Node2.java:314)
       at jess.Node2.doRunTestsVaryRight(Node2.java:299)
       at jess.Node2.runTestsVaryRight(Node2.java:292)
       at jess.Node2.callNodeLeft(Node2.java:156)
       at jess.NodeJoin.passAlong(NodeJoin.java:99)
       at jess.Node2.tokenMatchesLeft(Node2.java:328)
       at jess.Node2.doRunTestsVaryRight(Node2.java:314)
       at jess.Node2.doRunTestsVaryRight(Node2.java:299)
       at jess.Node2.runTestsVaryRight(Node2.java:292)
       at jess.Node2.callNodeLeft(Node2.java:156)
       at jess.Node1RTL.passAlong(Node1RTL.java:46)
       at jess.Node1RTL.callNodeRight(Node1RTL.java:28)
       at jess.Node1.passAlong(Node1.java:49)
       at jess.Node1MTELN.callNodeRight(Node1MTELN.java:35)
       at jess.Node1.passAlong(Node1.java:49)
       at jess.Node1TECT.callNodeRight(Node1TECT.java:40)
       at jess.NodeRoot.passAlong(NodeRoot.java:39)
       at jess.NodeRoot.callNodeRight(NodeRoot.java:14)
       at jess.FactList.processToken(FactList.java:31)
       at jess.FactList._assert(FactList.java:210)
       at jess.FactList.assertFact(FactList.java:181)
       at jess.Rete.assertFact(Rete.java:548)
       at jess.FactFunctions$Assert.call(FactFunctions.java:50)
       at jess.FunctionHolder.call(FunctionHolder.java:35)

real    30m12.867s
user    27m48.316s




tx
J





--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------



Re: JESS: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

by jo-48 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
The reason they have to run so long is that I have a lot of data to *parse* and only need to keep a very small percentage. In this particular case I had a *fact leak* :) It did make me concerned though if I could prevent this from happening by offering reduced functionality or by splitting up calculations in more steps... Unfortunately I am competing for memory on this system and can not even run 2 jess instances in parallel.

tx
J


From: James Owen <jco2009@...>
To: jess-users@...
Sent: Tuesday, September 15, 2009 5:38:19 PM
Subject: Re: JESS: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Just one more thought - if your rules are taking 30 MINUTES rather than 30 seconds then it sounds like you have some kind of loop going on that is building (adding to) memory over and over and over.  The Miss Manners benchmark does this intentionally to "stress" the rule engine and, in particular, the Agenda matching table, to see if the engine can handle overloads such as this.

Check to see which rule is firing the most and you will probably find your problem child somewhere in that general area.  

SDG
James Owen
Founder October Rules Fest
Senior Consultant / Architect KBSC
Twitter: OctRulesFest
Blogs:
http://JavaRules.blogspot.com [Rulebased Systems Blog]
http://ORF2009.blogspot.com [October Rules Fest Blog]
http://exscg.blogspot.com/ [Expert Systems Consulting Group Blog]

"If I have seen a little further it is by standing on the shoulders of giants."
Sir Isaac Newton in a letter to Robert Hooke, 5 Feb 1676

Come to October Rules Fest and stand on the shoulders of the Giants of the industry; if only for a week.



On Sep 14, 2009, at 8:42 AM, jo wrote:

Hi

I got following error, which surprises me as I try to keep the amount of facts to a minimum.

Can I detect this condition *before* it is about to happen ? Any ideas on how to prevent this ?  

30m is really not that long :(

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
       at jess.factory.FactoryImpl.newToken(FactoryImpl.java:27)
       at jess.Node2.tokenMatchesLeft(Node2.java:326)
       at jess.Node2.doRunTestsVaryRight(Node2.java:314)
       at jess.Node2.doRunTestsVaryRight(Node2.java:299)
       at jess.Node2.runTestsVaryRight(Node2.java:292)
       at jess.Node2.callNodeLeft(Node2.java:156)
       at jess.NodeJoin.passAlong(NodeJoin.java:99)
       at jess.Node2.tokenMatchesLeft(Node2.java:328)
       at jess.Node2.doRunTestsVaryRight(Node2.java:314)
       at jess.Node2.doRunTestsVaryRight(Node2.java:299)
       at jess.Node2.runTestsVaryRight(Node2.java:292)
       at jess.Node2.callNodeLeft(Node2.java:156)
       at jess.NodeJoin.passAlong(NodeJoin.java:99)
       at jess.Node2.tokenMatchesLeft(Node2.java:328)
       at jess.Node2.doRunTestsVaryRight(Node2.java:314)
       at jess.Node2.doRunTestsVaryRight(Node2.java:299)
       at jess.Node2.runTestsVaryRight(Node2.java:292)
       at jess.Node2.callNodeLeft(Node2.java:156)
       at jess.Node1RTL.passAlong(Node1RTL.java:46)
       at jess.Node1RTL.callNodeRight(Node1RTL.java:28)
       at jess.Node1.passAlong(Node1.java:49)
       at jess.Node1MTELN.callNodeRight(Node1MTELN.java:35)
       at jess.Node1.passAlong(Node1.java:49)
       at jess.Node1TECT.callNodeRight(Node1TECT.java:40)
       at jess.NodeRoot.passAlong(NodeRoot.java:39)
       at jess.NodeRoot.callNodeRight(NodeRoot.java:14)
       at jess.FactList.processToken(FactList.java:31)
       at jess.FactList._assert(FactList.java:210)
       at jess.FactList.assertFact(FactList.java:181)
       at jess.Rete.assertFact(Rete.java:548)
       at jess.FactFunctions$Assert.call(FactFunctions.java:50)
       at jess.FunctionHolder.call(FunctionHolder.java:35)

real    30m12.867s
user    27m48.316s




tx
J





--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------




JESS: [Jess] ORF 2009 Keynote Speaker Announcement

by James Owen-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

sm_headerlogo.jpg

[With Permission, of course]

Greetings:

This will be our penultimate email about October Rules Fest 2009 - but, even though it follows closely on the heels of the previous email, it's necessary.  And it's a goodie.  

Our Keynote Speaker for ORF 2009 is Tom Cooper, co-author of "Rule-Based Programming in OPS5" by Tom Cooper and Nancy Wogrin.  (Thanks to Luke Voss and Andrew Waterman for making a last-minute agenda shuffle possible.)  The book is long since out-of-print but is still available in slightly used condition by many of Amazon's associated book resellers.   (I saw only four "used but in good condition" copies at Amazon itself.)  When Dr. Forgy and I were working on our first project together back in 1998, I asked him what would be the one book that a person might buy to get a good foundation on rulebased programming.  This was it and I have used it many times in my classes that I teach on the subject.  

Side note:  I also use Gary Riley's book - still in publication -  to teach CLIPS (and Jess) and many others for reference; such as "Jess In Action" by Dr. Ernest Friedman-Hill or the Buchanan-Shortliffe magnum opus on the MYCIN project.  You can see my comlete list at http://www.kbsc.com/aibooks.html for more of them.  Even though some (most?) of the books are out-of-print none are really out-of-date.

STUDENTS can now register for ORF 2009 for only $150 per person WITH a valid photo ID and a CURRENT student photo ID card.  Last year we priced the whole thing at student rates and did not get a single student registeration from the USA.  (We had one from the UK.)  We have had several inquiries this year, some from as far away as California, and decided to put the student rate back online.  Just click on the regular ORF registration link and it will give you the instructions for the special student registration process.

We have two (yep, 2 of them) BOOT CAMPS that are co-located with ORF in The Adolphus Hotel.  There will be the Jess Boot Camp (taught by Jason Morris) and the Drools Boot Camp (taught by Mark Proctor and Edson Tirelli).  Even though both boot camps are headed by their individual instructors, we are posting the curriculum of both on-line with the ORF agenda.  (Topics are subject to change.)  Both camps have done a lot of work the past few days one defining what to expect from each of them.  If you like, you really CAN attend just one of the boot camps (for a small fee to cover the cost of the meeting room and catered coffee) and not attend ORF - but why???  ORF attendees can attend either one of the boot camps free of charge.

I will try and send another email before the 15th but in case that I don't, remember that the special $129 / night room rate for October Rules Fest 2009 attendees at The Adolphus will EXPIRE on the 16th !!  So I urge that if you have not already registered for ORF as well as reserved a room at The Adolphus, please do so this week if possible.

BTW, thanks to ALL of you who have already signed up and/or have registered at The Adolphus.  The rooms are filling up.  Boot Camps are filling up.  And, thankfully, October Rules Fest is filling up with some great folks looking for answers to some really perplexing problems.  So, if you have NOT registered, do so now.  If you know of some students who want to attend, put them in touch with Chelanie who can get them registered.  If all you want is one of the two greatest boot camps in the world, you can sign up just for that.  But you need to sign up now!!

SDG
James Owen
Founder October Rules Fest
Senior Consultant / Architect KBSC
Twitter: OctRulesFest
Blogs:
http://JavaRules.blogspot.com [Rulebased Systems Blog]
http://ORF2009.blogspot.com [October Rules Fest Blog]
http://exscg.blogspot.com/ [Expert Systems Consulting Group Blog]

"If I have seen a little further it is by standing on the shoulders of giants."
Sir Isaac Newton in a letter to Robert Hooke, 5 Feb 1676

Come to October Rules Fest and stand on the shoulders of the Giants of the industry; if only for a week.