comp.lang.ada
 help / color / mirror / Atom feed
From: boehm@parc.xerox.com (Hans Boehm)
Subject: Re: Reference Counting (was Re: Searching Method for Incremental Garbage Collection)
Date: 2 Dec 1994 21:58:55 GMT
Date: 1994-12-02T21:58:55+00:00	[thread overview]
Message-ID: <3bo5av$683@news.parc.xerox.com> (raw)
In-Reply-To: 3bjl64$1q8@scipio.cyberstore.ca

kevinw@whistler.com (Kevin Warne) writes:

>In article <3bii2g$kn2@news.parc.xerox.com>, boehm@parc.xerox.com (Hans Boehm) says:
>>You do need at least a write barrier on the heap for incremental collection.
>>(In the best case, the dirty bits in the MMU are a sufficient
>>write barrier, though not for that algorithm.  But using them is likely

>Can you think of a realistic incremental collection algorithm 
>that uses MMU dirty bits?  At best I suppose a collector could perform
>a collection and then freeze the application while it rescanned
>pointers in areas covered by dirty bits.

Ours :-).  You essentially just described the algorithm.  The rescanning
takes some work, but that's typically on the order of 10% of the work
required by a full mark phase.  It also has the big advantage that with
probability nearly one, this mark phase can look only at pages that were
recently modified, and hence are nearly certain to be in physical
memory.  There are some measurements of this scheme in the 1991 SIGPLAN
PLDI paper by Alan Demers, Scott Shenker, and myself.

I would argue that on modern workstation/PC processors this is almost
always good enough for interactive (100msec) response.  With good
OS support, it's probably barely adequate for animation on a fast machine.
If you have stronger real-time requirements, you need dirty information
with better granularity than 4K pages.

>And don't forget all those OSs who keep the dirty bits to themselves.
>Just imagine the hell involved to access those bits under the likes
>of Windows NT and OS/2 (and other operating systems).

The OS vendors haven't let me forget, unfortunately.  Actually
I'm told that it's possible to fake dirty bits under NT by write-
protecting pages and catching faults.  But the NT exception model
makes that a bit clumsy, and I haven't implemented it.  (This is
actually the strategy we currently use under SunOS4.X, Irix, and OSF/1.
Solaris 2.X supports direct retrieval of kernel maintained dirty bits,
though the current implementation is slower than it should be.)

>>The crucial issue in my mind is whether you can safely avoid counting
>>pointers from the stack.

>Any incremental collector (RC or tracing) is going to need a stack
>barrier unless either A) stacks are scanned atomically at the end of a 
>collection period along with the objects that they reference or B) 
>stack objects have restrictions during collection about what kind of
>heap objects they may point to.  Otherwise stack-based references can 
>circumvent heap barriers.

Agreed.  But scanning the stack(s) atomically at the end shouldn't
be a big deal for most applications.  If you need better than 10msec
response time, then it's a problem and you have to pay for the stack
barrier.  (You can also use MMU dirty bits on the stack, though the
write protect/trap emulation of dirty bits has problems in this context.)

Note that simple RC algorithms are also unlikely to give you
10 msec response.  I suspect that many applications often drop 10K objects
at once.

Hans-J. Boehm
(boehm@parc.xerox.com)
Standard disclaimer ...



  reply	other threads:[~1994-12-02 21:58 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CzHCvp.9rM@rheged.dircon.co.uk>
     [not found] ` <TFB.94Nov21091959@burns.cogsci.ed.ac.uk>
     [not found]   ` <RFB.94Nov27213114@cfdevx1.lehman.com>
     [not found]     ` <3be0mh$1p7@gamma.ois.com>
     [not found]       ` <3bfprn$okr@scipio.cyberstore.ca>
1994-11-29 21:27         ` Reference Counting (was Re: Searching Method for Incremental Garbage Collection) R. William Beckwith
1994-11-30  2:27           ` Henry G. Baker
     [not found]           ` <DAG.94Nov30090717@bellman.control.lth.se>
1994-11-30 16:39             ` David Weller
1994-11-30 17:58               ` Erik Naggum
1994-11-30 23:14                 ` Michael Feldman
1994-12-09 14:19                 ` Ada 95 is the name Tucker Taft
1994-12-09 22:33                   ` Pat Rogers
1994-12-11 18:59                     ` Jean D. Ichbiah
1994-12-11 20:05                       ` Pat Rogers
1994-12-16  1:01                         ` Bob Duff
1994-12-12 14:50                       ` Garlington KE
1994-12-13 21:48                         ` Tucker Taft
1994-12-14 12:44                         ` Gentle
1994-12-14 17:34                         ` Jean D. Ichbiah
1994-12-10 10:10                   ` Marc Wachowitz
1994-12-11 21:37                     ` Bob Duff
1994-12-02 23:41             ` Reference Counting (was Re: Searching Method for Incremental Garbage Collection) Bob Duff
1994-12-03  8:16               ` Bill Birch
1994-11-30 18:59           ` Hans Boehm
1994-12-01  3:20             ` R. William Beckwith
1994-12-01  3:51               ` R. William Beckwith
1994-12-01 13:59               ` Henry G. Baker
1994-12-02  4:26                 ` R. William Beckwith
1994-12-02 21:37               ` Hans Boehm
1994-12-03 15:17                 ` Henry G. Baker
1994-12-09 22:07                   ` Bob Duff
1994-12-11 23:59                     ` Gary McKee
1994-12-12  5:04                       ` Henry G. Baker
1994-12-12 12:46                         ` R. William Beckwith
1994-12-16 19:35                         ` Bob Duff
1994-12-17 20:36                           ` Robert Dewar
1994-12-20  5:24                           ` Henry G. Baker
1994-12-12  9:36                     ` Robb Nebbe
1994-12-13 16:12                     ` Henry G. Baker
     [not found]     ` <3be0mh$1p7@ga <3bii2g$kn2@news.parc.xerox.com>
1994-12-01  4:58       ` Kevin Warne
1994-12-02 21:58         ` Hans Boehm [this message]
     [not found] <D06r8x.JBy@inmet.camb.inmet.com>
1994-12-02 17:32 ` Henry G. Baker
1994-12-05 20:59   ` Robert Firth
1994-12-06 14:15     ` Robert Dewar
1994-12-04  1:06 ` Rick Busdiecker
1994-12-04 18:57   ` R. William Beckwith
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox