Imagine a two-dimensional Java array -- an array of arrays. Imagine
that at the beginning, the "backbone" is allocated, but none of the
subarrays are. Now, when you add an object to this data structure,
you've got to allocate one of the subarrays. When you remove that one
object, you have a choice: you can leave the empty subarray, or you
can delete it. It turns out that with the typical kind of data Jess
encounters, removing it would be the wrong thing to do, since the next
thing you'll need to do is recreate that same array. It's more
efficient to just leave it. That's basically what's going on here.

You actually have some control over the maximum number of these
structures that can be allocated; see the documentation for the
set-node-index-hash function in the Jess manual.


I think Tom Seipp wrote:
> That makes sense. Another question I would have though is why the number 
> of "indicies" would be increasing if I'm not adding any new rules to the 
> network?
> 
> 
> [EMAIL PROTECTED] wrote:
> 
> >I think Tom Seipp wrote:
> >  
> >
> >>Hi,
> >>
> >>While using the trial version of 6.1p5 under a memory profiler, it 
> >>appears that there are a large number of instances of the jess.e class 
> >>(a class with if() and a() methods) that aren't being garbaged collected 
> >>ever.
> >>I'm resetting the rules engine and clearing storage regularly, but these 
> >>instances remain. Is there any other clearning necessary? or is anyone 
> >>else expereinceing the same thing?
> >>    
> >>
> >
> >Jess rules are compiled into a "Rete network," a complex data
> >structure that bears some similarity to the indexes of a database, but
> >on steroids. This class is a part of that network. There will be a
> >number of instances of this class for each rule you have defined, and
> >neither (reset) nor (clesr-storage) will have any affect on them. They
> >will exist as long as the rule(s) they are related to are defined.
> >
> >You should observe that some fraction of them will disappear for each
> >rule you remove using (undefrule), and they should all disappear if
> >you erase all the rules using (clear).
> >


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to