[racket-dev] Intro to 3m?

From: Nick Sivo (nick at kogir.com)
Date: Fri Mar 9 14:48:28 EST 2012


I'm optimizing some code and have used gc-info logging
to correlate substantial application pauses with GC occurrences.  This make
sense.  The obvious solution is to allocate less memory, but tracking down
where it's coming from isn't easy.  In the short term I plan to inject
(current-memory-use) based logging all over the code I'm optimizing, but
would like to develop and contribute something more generic and re-usable
if there's interest in it.

My ideal goal is to add logging that reveals which code is allocating
memory (how often, how much), and also, for each GC pass, the origin(s) and
final resting place of what was collected.

So now I'm trying to learn more about Racket's 3m garbage collector so I
can instrument it.  I've scoured the guide and reference, but found nothing
that gets into the details of the runtime/collector interaction and in
which code files that lives.  Before I start grepping through the source
and trying to piece it all together on my own, I figured I'd ask.  Some
pointers in the right direction, even vague hints of where to start, would
be awesome :)  Even a description of the build process - where xform comes
into play - would be infinitely helpful.

Please also feel free to tell me I'm crazy and point out something
obviously simpler I'm missing.  I just want faster code with fewer, shorter
GC pauses - I have no vested interest in how it happens, but would love to
contribute a useful tool if that makes sense.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120309/c5b59cc1/attachment-0001.html>

Posted on the dev mailing list.