how to determine a programs memory usage at runtime?

Bernard James POPE bjpop at cs.mu.OZ.AU
Mon Jun 21 03:58:18 EDT 2004


Hi all,

Is there any way I can find out or estimate the memory size
of a program while it is executing?

This may very well be problematic and system specific, but 
I haven't a clue where to look. Perhaps there is a posix
interface I am missing? Or a hook into the runtime?

Why do I want to know this?

I'm experimenting with interleaving the execution of
buddha's debugging algorithm with the execution of the
debuggee. Assume for the moment that the debuggee runs
in one thread and the debugger runs in another.

One strategy I want to test is running the debuggee until
some threshold of memory has been used, suspend the
debuggee and jump to the debugger, then possibly back again.

Cheers,
Bernie.


More information about the Glasgow-haskell-users mailing list