Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!howland.reston.ans.net!ix.netcom.com!netcom.com!rvill
From: rvill@netcom.com (Richard Villanueva)
Subject: Why garbage collection?
Message-ID: <rvillDL4v3n.I8r@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
Date: Sat, 13 Jan 1996 18:52:35 GMT
Lines: 25
Sender: rvill@netcom6.netcom.com

I understand the classical Lisp method of automatic garbage collection,
and it is very elegant.  It reserves only one bit per cons cell (the
mark bit).  However, on large systems, the long pause for garbage
collection is bad, so people look for more sophisticated methods.

My question is, why not plain old reference counts?  Couldn't you
reserve one byte per cons for the count, and if the count reaches 255,
the cell becomes immortal?  I know that circular lists are a problem,
but the system could easily find all CDR-loops, say when all other
space was exhausted.

In additon to being simpler and having fewer long pauses, this method
is probably faster in the long run in spite of the overhead for
tallying reference counts.

So am I missing something?  Or are there other methods that are even
better?

--

+===============================================================+
| Richard Villanueva  |  Art and science cannot exist but in    |
| San Diego, Calif.   |  minutely organized particulars.        |
| rvill@netcom.com    |                        -- William Blake |
+===============================================================+
