[MLton-devel] new heap resizing approach

Stephen Weeks MLton@mlton.org
Mon, 22 Apr 2002 15:44:27 -0700


> I guess I would think of from space as y, which MIGHT be L * x, but might not.

When we allocated from space, we chose it's size so that at the next
GC, we will be able to do the GC in memory.  When we're allocating the
new to space, it doesn't matter what the from space size is.  We're
going to use exactly the same amount of to space no matter how big it
is.  So, all we can do is choose to space size so that the next GC
goes smoothly.  To do that, we estimate that x will be live at the
next GC and so choose to space size as L * x.

We could do a bit better by allocating a really huge to space, and
then shrinking it down after the GC when we know how much was live.
Then our guess would be only one GC early instead of two.  But
shrinking doesn't work well on windows, and I'm doubtful the guess
would be that much better.

_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel