[gclist] conservative stack scanning in Emacs

Dave Love d.love@dl.ac.uk
27 Jul 2001 13:46:00 +0100


At one time there was some argument here over whether Emacs and
similar systems would leak badly using conservative stack scanning.  I
think Hans's experience with similar systems was that they didn't, and
there wasn't an obvious mechanism for it occurring in Emacs.

Well, I should have reported long ago that the experiment was done in
the Emacs development sources (implemented by Gerd Moellmann).  The
result is that it works fine.  For a while we ran it on several
platforms in a mode where the GCPRO macros (protecting stack allocated
Lisp objects) were used to check for false positives.  There were very
few (typically ~2-5 at times when I took statistics), over protracted
heavy use and they didn't cause serious leaks.  GCPROs are now a no-op
on several platforms where it's known how to scan the stack correctly.

I hope that's a useful datum.

[Emacs does appear to fail to reclaim space for some reason that needs
investigating, but it's an old effect, unrelated to the GCPRO
mechanism, and possibly not related to GC.  My Emacs processes tend to
grow asymptotically to ~25MB after a few days of hacking and Gnus
usage, but they always did.

Of course, Emacs still doesn't have a decent GC :-(.  Anyone want to
work on it?]