Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!oberon!bloom-beacon!mit-eddie!rutgers!iuvax!pur-ee!uiucdcs!uiucdcsp!johnson From: johnson@uiucdcsp.cs.uiuc.edu Newsgroups: comp.lang.smalltalk Subject: Re: Smalltalk for (embedded) real-time Message-ID: <80500017@uiucdcsp> Date: Wed, 9-Sep-87 09:42:00 EDT Article-I.D.: uiucdcsp.80500017 Posted: Wed Sep 9 09:42:00 1987 Date-Received: Sat, 12-Sep-87 06:02:19 EDT References: <1881@tekig4.TEK.COM> Lines: 37 Nf-ID: #R:tekig4.TEK.COM:1881:uiucdcsp:80500017:000:1780 Nf-From: uiucdcsp.cs.uiuc.edu!johnson Sep 9 08:42:00 1987 In fact, most Smalltalk implementations employ BOTH reference counting AND garbage collection. Actually, most of the Smalltalk interpreters build recently do not employ reference counting. Most use generation scavenging, a particular garbage collection algorithm. Reference counting is used to detect "dead" objects (i.e. objects which are no longer referenced by any other object). This is exactly what reference counting does. Eventually, fragmentation resulting from allocation and reallocation of a given segment of memory may require garbage collection (i.e. the relocation of "live" objects to coalesce the free memory of the segment into one block) in order to keep the system from going belly up. This is compaction, not garbage collection. Garbage collection is detecting all objects that can no longer be accessed and recovering their space. An object might be referenced by another "dead" object and so not be considered garbage by a reference counting algorithm. A cycle of these dead objects will not be recovered by a reference counting algorithm and so a reference counting algorithm is usually backed up by a mark-and-sweep garbage collection algorithm or something like that. Reference counting is really a particular form of garbage collection that is fairly cheap but that occasionally misses garbage. Generation scavenging is better, at least for Smalltalk. The original article on generation scavenging was by Dave Ungar and is reprinted in the May 84 issues of SIGPLAN Notices and Software Engineering News. Tektronix uses generation scavenging in their interpreter. The only company that uses reference counting in their Smalltalk interpreter is Xerox, and I have heard that they are planning on going to generation scavenging.