I see no need for you to rush the garbage collector. It will run when
the System.totalMemory has reached some predetermined ceiling, and
when it runs, you can trust that it will count references and also
mark-and-sweep. Circular references should be no problem for the GC.
Memory leaks are caused by other things.
An important thing to consider, though, is whether you really want to
delete this object of yours. It has a circular reference, so I'm
betting it contains some complicated code. Rather than deleting it
and creating new ones, you may want to try recycling the objects that
you have. That way, memory management won't be such a big issue, and
your code will conserve memory.
-Rez
On May 13, 2007, at 10:41 PM, Joshua Sera wrote:
So if the Garbage collector delete classes with no
references to them immediately, but waits to do the
more expensive check to see if the class has no
references from the root, then with your classes that
you know will have circular references, would it be a
good idea to write a dispose method that does a for in
loop on the instance, and deletes everything it can
find?
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com