Hi Alan (and innocent bystanders)...
New release coming up, and I would like to close out some of the old
'bug reports' that I have lying around. This one I don't think is a
real problem; I don't replicate it. The following program:
;For each of 10,000 items
;begin
; convert the item to a jess fact
; assert the fact
; call run
;end
;
(deffunction driver ()
(bind ?i 1000000)
(while (> ?i 0)
(assert (foo ?i))
(run)
(bind ?i (- ?i 1))
(printout t ?i crlf)))
;And in my rule I:
; match the fact to get the fact id
; then I:
; retract the fact.
;end
(defrule retractor
?f <- (foo ?)
=>
(retract ?f))
(driver)
Runs for as long as you can stand it; on my NT box, the memory image
is a constant 4720K - a reasonable value for a Java program. Alan, do
you have a counter example?
I think Alan Barton wrote:
>
> Sorry for harping on the problem for which you have given
> two answers, but...
>
> Ernest Friedman-Hill wrote:
>
> > I think Alan Barton wrote:
> > >
> > > Thank you for your response.
> > >
> > > I now have 2 questions for you :)
> > > 1) Is there a conference for JESS users or a regular/annual gathering?
> >
> > We've never had one, but there has been a semi-once-in-a-while CLIPS
> > conference. Would anyone on the list travel to either Livermore,
> > California (near SF) or Washington, DC if we held such a conference
> > for Jess users?
> >
> > > 2) What exactly does a retract do?
> > >
> > > I have performed some tests with the following results...
> > >
> > > Rule for Test 1: Match all facts in the fact list then print the fact.
> > > Rule for Test 2: Match all facts in the fact list then print the fact and
>retract the fact.
> > >
> > > For test 1: I would expect (if I have 16m of RAM and 10,000 facts are
> > > asserted) that I would run out of memory... as you stated...
> > > For test 2: I would expect (if I have 16m of RAM and 10,000 facts are
> > > asserted) that I would NOT run out of memory because I am
> > > under the impression that the fact is completely deleted from the
> > > Rete network and hence should require no more memory.
> >
> > It is, but it's not deleted until the (retract) is called, and it
> > won't be called until RHS processing starts (i.e., until (run) is
> > called. ) All the memory-intensive stuff happens during calls to
> > (assert) and/or (reset) and/or (modify). If you assert the 10,000
> > facts, the damage (as demonstrated in the math I did last time) is
> > done - you run out of memory before (run) is ever called.
>
> Ok, here is a more detailed version of what I have been trying to say...
>
> For each of 10,000 items
> begin
> convert the item to a jess fact
> assert the fact
> call run
> end
>
> And in my rule I:
> match the fact to get the fact id
> then I:
> retract the fact.
> end
>
> So as I see it, the RHS processing should be performed everytime I call run.
> Which happens everytime I assert each of the 10,000 facts. Therefore,
> I should never run out of memory... but alas, I still do!
>
> Thank you again for your reply,
> 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]
> ---------------------------------------------------------------------
>
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9214 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------