It's not an easy measurement to even define. There was a huge debacle recently about a windows program that reported misleading numbers about used memory. The fact that GHC has its own allocator and "hogs" OS memory (it never returns it to the OS) might complicate the definition further. But in general, if you're looking for an OS-level measure you're probably going to need to go to the FFI and talk to the specific OS's API for the task. I'm not sure if the GHC runtime allows you to ask much about allocated memory. The only thing I've done with it was FFI out to a variable that counts the number of bytes allocated to measure allocations in calls like GHCi does. <div>
<br><div class="gmail_quote">On Tue, Apr 27, 2010 at 12:01 PM, Mads Lindstrøm <span dir="ltr"><<a href="mailto:mads.lindstroem@gmail.com">mads.lindstroem@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi<br>
<br>
I have tried <a href="http://haskell.org" target="_blank">haskell.org</a>, Google and Hoolge, but I cannot find any<br>
function to give me the available and/or used memory of a Haskell<br>
program. Is it just not there? Or am I missing it somehow?<br>
<br>
<br>
/Mads<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div>