<div dir="ltr"><div>I am trying to get GHC builder-clients running for x86 and x86_64 GHC on SmartOS.</div><div><br></div><div>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.<br>
</div><div><br></div><div>The three latest builds die with the following message:</div><div><span style="color:rgb(255,0,0);font-family:monospace;font-size:medium;white-space:pre">ghc: out of memory (requested 2097152 bytes)</span></div>
<div><span style="color:rgb(0,0,0);font-family:monospace;font-size:medium;white-space:pre">compiler/<a href="http://ghc.mk:641">ghc.mk:641</a>: recipe for target 'compiler/stage1/build/DynFlags.o' failed</span><span style="color:rgb(255,0,0);font-family:monospace;font-size:medium;white-space:pre"><br>
</span></div><div><a href="http://haskell.inf.elte.hu/builders/smartos-x86_64-head/16/10.html">http://haskell.inf.elte.hu/builders/smartos-x86_64-head/16/10.html</a><br></div><div><a href="http://haskell.inf.elte.hu/builders/smartos-x86_64-head/17/10.html">http://haskell.inf.elte.hu/builders/smartos-x86_64-head/17/10.html</a><br>
</div><div><a href="http://haskell.inf.elte.hu/builders/smartos-x86_64-head/18/10.html">http://haskell.inf.elte.hu/builders/smartos-x86_64-head/18/10.html</a><br></div><div><br></div><div>All of these were run interactively from the builder directory:</div>
<div>builder-client --do-build</div><div><br></div><div>Here's my zone setup:</div><div>image: SmartOS base64 13.4.2</div><div>max_physical_memory: 4GB</div><div>max_swap: 8GB</div><div>disk_quota: 200GB</div><div><br>
</div><div># ulimit -a</div><div><div>core file size          (blocks, -c) unlimited</div><div>data seg size           (kbytes, -d) unlimited</div><div>file size               (blocks, -f) unlimited</div><div>open files                      (-n) 65536</div>
<div>pipe size            (512 bytes, -p) 10</div><div>stack size              (kbytes, -s) 10240</div><div>cpu time               (seconds, -t) unlimited</div><div>max user processes              (-u) 12261</div><div>virtual memory          (kbytes, -v) unlimited</div>
</div><div><br></div><div>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.</div>
<div><br></div><div>This doesn't happen when I run make directly from a shell myself.  It looks like a defect in the GHC builder-client itself.</div><div><br></div><div>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:</div>
<div><a href="https://github.com/haskell/ghc-builder/blob/master/client/client.hs#L54">https://github.com/haskell/ghc-builder/blob/master/client/client.hs#L54</a><br></div><div><br></div><div>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.</div>
<div><br></div><div>If anyone has any other ideas I'd be very happy for the help.</div><div><br></div><div>Best,</div><div>Alain</div><div><br></div></div>