[Vm-dev] Re: [squeak-dev] Image Segment semantics and weakness

David T. Lewis lewis at mail.msen.com
Wed Oct 22 00:17:08 UTC 2014


On Tue, Oct 21, 2014 at 04:29:53PM -0700, Yoshiki Ohshima wrote:
> I'm not fully following the discussion here, but I do remember seeing
> the following email from Dan in 1999:
> 
> http://lists.squeakfoundation.org/pipermail/squeak-dev/1999-March.txt
> 
> and search for: "From DanI at wdi.disney.com Fri Mar 26 07:17:09 1999"
> 
> It does not require two bits to mark.
> 
> (Hopefully this email has some relevance to the discussion at hand...

I don't know if it is directly relevant to the specific discussion,
but it is definitely worth rereading this post from Dan. I remember
being amazed at its simplicity when I first read it in fifteen years
ago, and what stands out to in retrospect is that we seem to have
largely overlooked what he apparently considered to be its main potential
application: "Steps to Modularity - Incremental Snapshots"

Thanks for the pointer :-)

Dave

Here is a copy of the squeak-dev post from 1999:

>From DanI at wdi.disney.com  Fri Mar 26 07:17:09 1999
From: DanI at wdi.disney.com (Dan Ingalls)
Date: Sat Jan 28 04:56:45 2012
Subject: Steps to Modularity - Incremental Snapshots
Message-ID: <v0300780cb320dafbd7ab@[206.16.10.26]>

Folks -

A week or so ago, I sent out a message describing a technique for extracting segments from the Squeak image.  What I want to know is,

	Does anyone know of such a technique having being used previously?

I figure it must be known, but I have certainly never heard of it.  Please reply directly to me.

To recap, here's how it works:

	1.  Mark the root (or roots) of the subtree desired.

	2.  Do a GC mark pass.  SInce this stops at any marked objects,
	the subtree will be unmarked, "in the shadow" of its roots.

	3.  Copy the roots and the unmarked subtree into a byteArray (the image segment)
		Relocate internal pointers as you go
		Copy external pointers into a table of outpointers.

	Reinstalling a segment is incredibly simple -- all you do is remap any
		pointers in one pass and throw away the byteArray header!

Thanks
	- Dan

PS...
Ted and I have just completed an implementation and it is great.  (It will be out in updates and release 2.4 within a week).  It can trace and copy a 520kb tree of over 15000 objects in about 390ms.  Used for deepCopy, it is about 20 times faster than what we do currently.  Used to swap segments in and out, it finally offers a realistic vehicle for breaking down Squeak's monolithic images.

It's even faster than you would guess from the above.  There is a fixed overhead for the full GC mark and unmark.  This is 350ms on my machine (could surely be improved).  It can then copy out the 520kb segment or reinstall it in about 40ms either way.






More information about the Vm-dev mailing list