[1249] in java-interest
Re: Garbage Collection
daemon@ATHENA.MIT.EDU (Mark Lanett)
Sun Aug 27 22:22:36 1995
Date: Sun, 27 Aug 1995 15:47:51 -0700
To: java-interest <java-interest@java.sun.com>
From: mlanett@meer.net (Mark Lanett)
At 11:03 AM 8/27/95, Philip R Brenan wrote:
>Suppose I have several mutually refering objects. I.e. A refers to B
>which in turn refers to A. How will Garbage Collection know when to free
>these objects, as their use count will always be at least 1?
"use count" is only relevant when reference counting is being used. That's
a simple but slow memory management technique. A mark and sweep collector
doesn't have this problem (it starts at "root" objects and follows their
references to find all live objects).
A good incremental and generational mark and sweep collector is tough to
write. Anything less wastes memory or cpu needlessly. I don't know what
Java uses. Mindy (the Dylan interpreter from CMU) has a simple mark and
sweep collector.
mark l
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com