My goal is to serialize the Rete, I am definstanceing a fact based off of a
non-serializble object, doing a bunch of stuff. Then undefinstancing the
non-serializble objects fact just before Serializing the Rete. I get an
exception thrown saying it was unable to Serialize the non-serializable
object. This implies that somehow a reference to this retracted fact is
hanging around in the Rete and is attempting to be serialized.


We had implemented the change described below with version Jess60 and it
fixed the problem,
We have now moved to Jess61a1 and while this exact fix is in there it seems
a different reference to the retracted fact now remains.
I will try and get more info to where specifically the reference is being
held I was hoping this was a known issue, or that knowing what has changed
between versions can assist in tracking it down. Thank so much for your
help.

Jim

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, April 02, 2002 9:34 AM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Defrules keep references to retracted facts



I'm actually aware of this and the fix is going to be in the next
release. The patch involves replacing three methods in
jess/TokenVector.java with new versions:

  final void clear() {
      if (m_ptr > 0) {
          Arrays.fill(m_v, 0, m_ptr, null);
          m_ptr = 0;
      }
  }

  final void removeElementAt(int i)
  {
    m_v[i] = m_v[m_ptr-1];
    m_v[--m_ptr] = null;
  }

  final void removeElement(Token t)
  {
    for (int i=0; i<m_ptr; i++)
      if (t.dataEquals(m_v[i]))
        {
          removeElementAt(i);
          return;
        }
  }





I think Ian de Beer wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi
> We noticed  when running a profiler on our application that even though we
> retract / undefinstance facts that are no longer used, jess retains a
> reference to those facts, therefore preventing the garbage collector from
> releasing heap space.  This cause our application to steadily outgrow
> available memory.
> Is there a way of clearing old references from defrules while running Jess
> in run-unit-halt mode - _reset_ seems to be an obvious way to do just
that,
> but when is an opportune time to that, if you are constantly asserting new
> facts?
> Regards
> Ian
>



---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [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
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------



--------------------------------------------------------------------
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