[plt-scheme] Getting mem usage?

From: Adam Wick (awick at cs.utah.edu)
Date: Fri Jun 11 21:15:10 EDT 2004

At Wed, 9 Jun 2004 09:38:34 +0200, "ifconfig" wrote:
> You can use dump-memory-stats is supposed to "dump information about memory
> usage to the (low-level) standard output port", but I have yet to figure out
> what output port that is.

As far as I can tell, this should be "(low-level) standard error port"
(stderr on Unix and OS/X). There seems to be a bug in that OS/X, at 
least, pops up a console window showing standard out, which displays
nothing. Or maybe the bug is that the collectors really should dump to
standard out. 

> Strangely, though, the same function in MzScheme (and not DrScheme) gives me
> this strange result:

This seems to be working fine for me:

Welcome to MzScheme version 207.1, Copyright (c) 2004 PLT Scheme, Inc.
> (define (test-gc) (printf "Before: ~a~n" (current-memory-use)) (collect-garbage) (printf "After: ~a~n" (current-memory-use)))
> (test-gc)
Before: 741376
After: 692224

Is there something else potentially interfering? If not, what platform
are you running on?

> Also, why does DrScheme with a blank window use 62.2 times the memory as
> MzScheme?

MzScheme contains none of the GUI infrastructure. MrEd programs like
DrScheme -- MrEd is the extended version of MzScheme with the GUI stuff --
tend to use much larger amounts of memory because of this. MzScheme3m
on my machine reports ~540k after startup+GC, MrEd3m reports ~11,600k.
DrScheme, being a fairly large and complex bit of software, uses a bit more
on top of this.


Posted on the users mailing list.