[Haskell-cafe] Getting used and available memory

Daniel Peebles pumpkingod at gmail.com
Tue Apr 27 15:32:07 EDT 2010

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.

On Tue, Apr 27, 2010 at 12:01 PM, Mads Lindstrøm
<mads.lindstroem at gmail.com>wrote:

> Hi
> I have tried haskell.org, Google and Hoolge, but I cannot find any
> function to give me the available and/or used memory of a Haskell
> program. Is it just not there? Or am I missing it somehow?
> /Mads
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100427/0a094c84/attachment.html

More information about the Haskell-Cafe mailing list