[Haskell-cafe] GHC 7.0.1 developer challenges

John D. Ramsdell ramsdell0 at gmail.com
Thu Dec 16 23:20:31 CET 2010

On Thu, Dec 16, 2010 at 4:45 AM, Ketil Malde <ketil at malde.org> wrote:
> In absence of any explicit limits, I think a sensible default is to set
> maximum total memory use to something like 80%-90% of physical RAM.

This would be a poor choice on Linux systems.  As I've argued
previously in this thread, the best choice is to limit the GHC runtime
to the free memory and the reclaimable memory of the machine.  The
correct amount of memory can derived by consulting /proc/meminfo.

On the laptop I'm using right now, physical memory is 1G.  Free memory
is 278M, and free plus reclaimable memory is 590M.  I'm just running
Firefox and X, so the OS as allocated a lot of memory to caches.  In
any event, if you picked 80% of physical memory,  it would be way
beyond 590M, and programs would thrash.  Note that if you limit the
GHC runtime to free plus reclaimable memory, and some other process is
chewing up memory, the GHC limit would be small.  But this would
ensure both do not thrash, a good thing, right?


More information about the Haskell-Cafe mailing list