GHC builder: out of memory from ghc during make

Alain O'Dea alain.odea at gmail.com
Tue Apr 29 05:59:02 UTC 2014


I am trying to get GHC builder-clients running for x86 and x86_64 GHC on
SmartOS.

I have been trying to get to the bottom of this memory issue and have had
no luck.  I've set it aside for the past couple of days to try to get a
clear head to attack it afresh tonight.

The three latest builds die with the following message:
ghc: out of memory (requested 2097152 bytes)
compiler/ghc.mk:641: recipe for target 'compiler/stage1/build/DynFlags.o'
failed
http://haskell.inf.elte.hu/builders/smartos-x86_64-head/16/10.html
http://haskell.inf.elte.hu/builders/smartos-x86_64-head/17/10.html
http://haskell.inf.elte.hu/builders/smartos-x86_64-head/18/10.html

All of these were run interactively from the builder directory:
builder-client --do-build

Here's my zone setup:
image: SmartOS base64 13.4.2
max_physical_memory: 4GB
max_swap: 8GB
disk_quota: 200GB

# ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 10
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 12261
virtual memory          (kbytes, -v) unlimited

It doesn't use anywhere near the 4GB of memory or 8GB of swap allocated to
the zone.  Total zone RSS (physical memory usage) stays under 200MB for the
entire builder-client run.  I took regular snaps of memory during the build
run and saw no evidence of memory saturation or errors.  It's nowhere near
hitting swap limits either.   I think I've done all I can do to remove
system imposed resource limits.

This doesn't happen when I run make directly from a shell myself.  It looks
like a defect in the GHC builder-client itself.

If POSIX resources are available on the host (which they are on SmartOS)
builder-client sets a 1GB ResourceTotalMemory limit using
System.Posix.Resource.setResourceLimit:
https://github.com/haskell/ghc-builder/blob/master/client/client.hs#L54

I'm trying a build with the resource limit code commented out.  Hopefully
that will finally put this to bed.  Speaking of bed, I should probably
sleep too.

If anyone has any other ideas I'd be very happy for the help.

Best,
Alain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140429/f7272479/attachment.html>


More information about the ghc-devs mailing list