home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!gumby!yale!mintaka.lcs.mit.edu!ai-lab!life.ai.mit.edu!tmb
- From: tmb@arolla.idiap.ch (Thomas M. Breuel)
- Newsgroups: comp.lang.c++
- Subject: Re: Garbage Collection for C++
- Message-ID: <TMB.92Aug18165833@arolla.idiap.ch>
- Date: 18 Aug 92 20:58:33 GMT
- References: <1992Aug6.014619.2111@ucc.su.OZ.AU> <DAVEG.92Aug13025629@synaptx.synaptics.com>
- <TMB.92Aug16164940@arolla.idiap.ch>
- <1992Aug18.021453.24394@news.mentorg.com>
- <TMB.92Aug18123919@arolla.idiap.ch> <9223122.20958@mulga.cs.mu.OZ.AU>
- Sender: news@ai.mit.edu
- Reply-To: tmb@idiap.ch
- Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
- Perceptive)
- Lines: 40
- In-reply-to: fjh@munta.cs.mu.OZ.AU's message of 18 Aug 92 12:05:19 GMT
-
- In article <9223122.20958@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
-
- tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
-
- >Conservative GC with a "free" function is a safety net. If you don't
- >run out of storage, you don't know it's even there. If you do run out
- >of storage, it lets your program continue to run when it would
- >otherwise have crashed. Whether you want to rely on this feature is up
- >to you, but, in general, I can see no harm in having it in the
- >language...
-
- This presumes that you will only perform garbage collection when there
- is *no* more storage available.
- [...]
- It is therefore essential that a GC version of malloc() sometimes perform
- garbage collection even though there is still (virtual) memory available.
- The question is, how can we do this in a way that does not impact poorly
- on the performance of programs that do mostly manual allocation?
-
- I was responding to someone who claimed that GC cost him something
- just by being present in the language and applicable to all pointers.
-
- If you force concurrent or premature GC on the programmer, the feature
- will cost you something even if you don't use it. While I am for GC, I
- would be against that; by default, the GC should only be invoked once
- there is no more memory(*).
-
- Of course, there must exist the usual options to set GC aggressiveness
- (e.g., telling the GC to try to maintain a fixed ratio of live data
- and free space), and, maybe, even to run the GC concurrently with the
- C++ program.
-
- Thomas.
-
-
- (*) What this means is implementation dependent. On virtual memory
- machines, a sensible default notion of "no more memory" would be "no
- more real memory", since for most programs, performace becomes
- extremely once you start paging anyway. Under DOS, I think it's pretty
- clear what "no more memory" means.
-