[MLton-devel] MM with two mlton apps

Stephen Weeks MLton@mlton.org
Mon, 22 Jul 2002 12:39:51 -0700


> Note, if the secondary process is time-consuming enough, then all of this
> can be faked (modulo open files and signals) bu doing a saveWorld instead
> of the compact.  Still, not very nice.

SaveWorld does do a GC, but it doesn't try to save any RAM, so it is
not a replacement.  Unless you mean to do a save world, then exec the
child, and have the child, when done, do a load world to resume the
parent.  I guess that would work (again modulo open files and
signals), if we can trust the OS not to write the whole world to
disk.  GC_pack still sounds better to me.

> What is done in the new world with de-allocating the non-used space when
> not in a GC?  That would save a good chunk of the paging if it isn't done
> already (in the case where the process is still in stop-and-copy
> mode).

I don't understand your question.  In any case, saveWorld is very
simple -- see GC_saveWorld in gc.c.  It does a GC, which compacts all
the live data but still shoots for the desired live ratio.  Then it
writes out just the live data to the file, and continues.

> All in all I would think that a forced GC with an option which said to make
> the new to-space exactly the size of live data would be pretty cheap.

I agree.  Except that you don't want to space to be exactly the size of
live data -- you want a little slop just in case some allocation
happens before the spawn.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel