[Gc] Re: Partially scanning a VM's call stack

Shiro Kawai shiro at lava.net
Fri Aug 21 12:32:48 PDT 2009

From: ludo at gnu.org (Ludovic Courtès)
Subject: [Gc] Re: Partially scanning a VM's call stack
Date: Fri, 21 Aug 2009 02:03:19 +0200

> > I imagine that the effect of precise stack scanning is not to improve
> > the average cases but mainly to prevent the worst case scenario (in
> > which large amount of garbages are refered from unused stack area),
> > but such scenario rarely occurs.  The probability is not zero,
> > however, so in theory it is a good safety net to have.
> Right.  I was just hoping someone had actually crafted sample code to
> illustrate the worst case scenario.

After some thinking, I come to think the "worst case" may be
not that bad; at least the retained memory is bounded.  (If the 
retained object grows, it means the object itself is not
weak-gc-robust, but that's a different issue.)

> > since the stack in Gauche is closer to a nursery; whenever the stack
> > spills, active objects are moved to the heap.  The possibility of
> > excess retention grows if the VM stack gets larger.
> Hmm, interesting.  I guess
> https://practical-scheme.net/gauche/memo-stack-j.html describes it, but
> is there an English version or summary elsewhere?

No, no English version, and the page is slightly out of date.
What I'm doing is pretty simple copying GC, using stack space
as source and heap as destination.  The only trick is that
to make sure I can find all pointers point to VM stack, so that
I can rewrite it.


More information about the Gc mailing list