ImageSegments and massive GC

Stephen Pair spair at advantive.com
Thu Aug 23 13:56:51 UTC 2001


If you combined Rob's ideas about segmenting object memory using
Sentinel objects with that of ImageSegments, would that be a good
solution to large scale, persistent GC?

Using Sentinels, all roots of an image segment would be inward pointing
Sentinels, outpointers would be outward pointing Sentinels to some other
image segment(s).  Bringing image segments into an image, or dumping one
out of an image would no longer require full garbage collects or memory
scans because (a) the root Sentinels match their target object's
protocol 100% (note: this won't work entirely in the currect Squeak) so
a become is not required and (b) a full GC is not required when dumping
an image segment out of memory because the sentinels always protect new
references into an image segment (creating new sentinels if necessary). 

If we have a very large virtual image (on disk let's say), fully garbage
collecting that image may be prohibitively expensive, however, if the
image is segmented using this technique, we could have several
alternatives:

1) "Macro GC" - We scan from the root segment, but "hop" over other
image segments (we can do this because we know all of the inward and
outward sentinels.

2) "Micro GC" - We scan within an image segment, and only that image
segment (skipping over nested image segments and stopping at the
outbound Sentinels)

Image segments could be nested within other image segments, allowing for
arbitrarily deep nesting of this scheme.  Using this scheme, if you were
running low on disk space, you could start GC at the root segment, and
if you clean up an acceptable amount of space, you stop, if not, you
drill down into an image segment and GC that, and so on.

Would this work?  Has it been done before?

- Stephen

 





More information about the Squeak-dev mailing list