[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to free the memory occupied by the instance object?

 >From: Yao-Sheng Cheng <ee780569@twin1.src.ncu.edu.tw>
 >Newsgroups: comp.lang.lisp.mcl
 >     I am working to build a multimedia authoring system using MCL&CLOS.  
 >I have a problem that how to release the memory of objects created 
 >through make-instance. Does the MCL garbage collector is so clever to 
 >collect these memory back or I must explicitly call some functions to 
 >free these memory?

Yes, the MCL garbage collector is extremely clever. These objects
will be tracked automatically, and the memory will be reclaimed
when the objects are no longer used. An object is considered to
be "in use" if you can reach it by evaluating an expression, like
a global variable. So if you want an object to go away, make
sure it's not kept in a global variable, or indirectly referenced
from one.

You can invoke the garbage collector yourself by calling "(gc)",
but in general, you shouldn't need to. It'll run when it needs to,