Re: Building on limited memory environments (or does -M really work?)

2017-11-08 Thread Niklas Hambüchen
Hey Saurabh, from my experience with CircleCI it builds on machines with e.g. 32 cores showing up in htop (but allows you to use way less that that). But ghc sees 32 cores so -j will compile up to 32 modules at the same time (thus using tons of RAM). I solved that by setting -jN to the actual

Re: Building on limited memory environments (or does -M really work?)

2017-11-08 Thread Oleg Grenrus
Note that there are two -j flags, one to `stack` and one to `ghc`. I'm not completely sure what `stack`s -j does at the moment, but IIRC it specifies how many *packages* are built in parallel (maybe running tests is counted towards that job limit too). This means that `stack build -j3` may (and

Re: Building on limited memory environments (or does -M really work?)

2017-11-08 Thread Ben Gamari
Saurabh Nanda writes: >> >> Did you ever make any progress on this, Saurabh? >> > > We made progress in some sense, by introducing a separate `stack build -j1` > step in our CI pipeline for compiling packages that are known to use a lot > of memory. > > >> >> * -j just

Re: Building on limited memory environments (or does -M really work?)

2017-11-08 Thread Saurabh Nanda
> > Did you ever make any progress on this, Saurabh? > We made progress in some sense, by introducing a separate `stack build -j1` step in our CI pipeline for compiling packages that are known to use a lot of memory. > > * -j just tells GHC to parallelise compilation across modules. This can >

Re: Building on limited memory environments (or does -M really work?)

2017-11-06 Thread Ben Gamari
Saurabh Nanda writes: > Hi, > > 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: > > - 1,200+ modules > - 36,315 LoC of Haskell > - On the local machine with -O1 -j the build takes

Building on limited memory environments (or does -M really work?)

2017-10-21 Thread Saurabh Nanda
Hi, 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: - 1,200+ modules - 36,315 LoC of Haskell - On the local machine with -O1 -j the build takes approx 5.2 GB of RAM [1] Trying to build on CircleCI with