[gambit-list] Monitoring memory usage inside Gambit?

Jussi Piitulainen jpiitula at ling.helsinki.fi
Tue Oct 29 04:41:51 EDT 2013

Dear list,

is there a way to monitor Gambit's memory usage inside a program? I
know about the documented (gc-report-set! #t) and the apparently
undocumented (##gc), but I don't seem to get access to that report,
and I was unable to find other ways to access such information.

This is where I gave up (in gsi v4.6.7):

> (parameterize ((current-error-port (current-output-port)))
     (with-output-to-string '() ##gc))
*** GC: 1 ms, 427K alloc, 1.08M heap, 48.9K live (4% 26056+24056)

That is, the ##gc report bypasses current-error-port and I only get to
see the report on the screen.

I'm trying to get some empirical evidence that a certain API does not
leak memory. Those ##gc reports might be adequate on the Gambit side
as is, but I would still like to know if there is some way to access
this information inside the test program. Any pointers?

More information about the Gambit-list mailing list