Any thoughts on the following strange behaviour?

I have a template of this form:
( deftemplate templateName
        (slot slotOne)
)

And I have one rule:
(defrule oneRule
        ?factId <- (templateName (slotOne ?slotOne))
=>
        (printout t ?factId "," ?slotOne crlf)
        (retract ?factId)
)

The rule simply matches ALL asserted facts and then prints and retracts the fact.

STRANGE BEHAVIOUR:
I am trying to assert 10,000 facts; for example...
        (assert (name (slotOne 0)))
        (assert (name (slotOne 1)))
            ...
        (assert (name (slotOne 9999)))

and the Java Virtual Machine crashes, saying that I have run out of memory.

Here is a stack trace:
java.lang.OutOfMemoryError
        at java.lang.StringBuffer.append(Compiled Code)
        at jess.TextInputStream.appendText(Compiled Code)
        at jess.TextInputStream.read(Compiled Code)
        at java.io.StreamTokenizer.read(Compiled Code)
        at java.io.StreamTokenizer.nextToken(Compiled Code)
        at jess.JessToken.create(Compiled Code)
        at jess.JessTokenStream.prepareSexp(Compiled Code)
        at jess.JessTokenStream.eof(Compiled Code)
        at jess.Jesp.parse(Compiled Code)
        at jess.Rete.executeCommand(Compiled Code)
        at some of my wrapper code called here...

Do you know why, over time, the VM runs out of memory? and how I can
stop this from occuring? (I have tried System.gc() after a Rete.executeCommand(),
but that does not help.)

Thank you,
Alan.

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to