<div dir="ltr">Hi,
<div><br></div><div>We're struggling to get our build pipeline working on CircleCI, which has a 4GB RAM limit. Here are some project stats to set the context:</div><div><br></div><div>- 1,200+ modules</div><div>- 36,315 LoC of Haskell</div><div>- On the local machine with -O1 -j the build takes approx 5.2 GB of RAM [1]</div><div><br></div><div>Trying to build on CircleCI with -O1 -j fails consistently, as expected. However, the behaviour of -M -j -O1 is erratic, at best. Sometimes it magically works, sometimes it fails. A number of times we've seen GHC take 3.5 GB (as reported by `top`), even though the limit was set to 2.5GB. Here are flags that we've tried in various combinations we've tried. None of them is consistent in building / failing:</div><div><br></div><div>* -O1</div><div>* -j</div><div><div>* +RTS -M2621440000 -RTS</div></div><div><div><div>* +RTS -A32m -RTS</div><div></div></div></div><div><div><div>* +RTS -n2m -RTS</div><div><br></div><div>What is the **real** behaviour of the -M option? How does it interact with -j and -A?</div><div><br></div><div></div></div></div><div>[1] If I'm reading this correctly - <a href="https://gist.github.com/saurabhnanda/c8f8654a7f29c1adb753b357b897b5f3#file-building-library-01-txt-L8-L12">https://gist.github.com/saurabhnanda/c8f8654a7f29c1adb753b357b897b5f3#file-building-library-01-txt-L8-L12</a></div><div><br></div><div>-- Saurabh.</div></div>