home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: comp.lang.lisp
- Subject: Reference counting (was Re: Yet another Lisp Interpreter Available (RefLisp) Long)
- Date: 18 Dec 1992 00:19:31 GMT
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 29
- Message-ID: <1gr5ejINN3k5@early-bird.think.com>
- References: <1992Dec11.131657.19196@uk03.bull.co.uk> <1gk60iINNjg8@iraul1.ira.uka.de> <1992Dec17.200901.20942@uk03.bull.co.uk>
- NNTP-Posting-Host: telecaster.think.com
-
- In article <1992Dec17.200901.20942@uk03.bull.co.uk> bbirch@hemel.bull.co.uk (Bill Birch) writes:
- > - RefLisp has reference counting garbage collection, that means
- > memory is reclaimed as soon as it is un-used. It is a "non-stop"
- > system, in that there is never any halt for garbage collection (GC).
-
- This is a frequent claim that is simply not true. A reference counting
- system simply changes the time and distribution of the GC delays, but it
- doesn't eliminate it. For instance, if you allocate a million-element
- list, and then lose the pointer to the first element, that operation will
- take a million times longer than losing a pointer to the head of a
- one-element list, as it has to recursively deallocate all the objects in
- the list (assuming there are no other pointers into the list). No matter
- how fast your reference counting scheme is, I can always construct a data
- structure that takes a noticeable amount of time to deallocate it when the
- last pointer to the first element is dropped (assuming there's enough
- memory).
-
- Reference counting GC's also have the misfeature that they must reference
- the object that a pointer points to when the pointer is reassigned. On a
- system with demand-paged virtual memory, this could cause an unnecessary
- page fault, further slowing down the assignment.
-
- Modern generational garbage collectors also distribute the GC delays more
- evenly than old stop-and-copy or mark-sweep GCs.
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-