haskellghccabalcabal-installmemory-consumption

Limit memory used by cabal install?


I'm limited by 1GB memory on my server hosting. When I want to compile some big program like git-annex, Cabal eats lot of memory. Is there a way to limit cabal or gcl using some option to limit memory usage?

I updated question with some details: I'm running cabal (1.22.4.0) and Ghc 7.10.2 on the Webfaction hosting (CentOS 7 - 64bit), with access to shell (non root access). Webfaction admin/robot generally tolerate some burst due to compilation. But Ghc / Cabal need too much memory and spend too many minutes for certain package compilation. So system automatically kills all processes.

I need to relaunch the compilation many times to finally obtain a successful result.

My primary objective is that compilation ends with success, however long it takes.


Solution

  • @reyman64 suggestion confirmed to work on Xubuntu 18.04 with 2GB ram. Thanks! So, cabal install -v cabal-install hangs the system. The following works fine:

    cabal install -v --ghc-options='+RTS -M1G -RTS' cabal-install