Increase Heap size in GO
<p>Is there a way howto instruct GO runtime to use larger heaps? I am running <code>GO 1.5</code>.</p>

<p>My GO process is currently spending 34% of time in GC but it uses unly 1/3 of available systems memory. </p>

<p>I know <code>ulimit</code> can be used to limit max heap size. I have set ulimit to ~16GB (<code>ulimit -v 17179869184</code>) but the heap size never goes over 5GB.</p>

<p>Using <code>GODEBUG=gctrace=1</code> I can see high GC overhead (34%):</p>

<pre><code>20160719-220359.169294 :: gc 665 @5484.983s 34%: 3.3+2504+188+1635+8.0 ms clock, 26+2504+0+26950/3271/3.5+64 ms cpu, 4825-&gt;4964-&gt;2623 MB, 4948 MB goal, 8 P
20160719-220406.322354 :: gc 666 @5492.411s 34%: 2.9+212+2111+1749+8.3 ms clock, 23+212+0+25010/3496/146+67 ms cpu, 4846-&gt;4990-&gt;2657 MB, 4970 MB goal, 8 P
20160719-220413.703514 :: gc 667 @5499.452s 34%: 4.4+4411+0.021+0.25+8.4 ms clock, 35+4411+0+29365/0.054/38+67 ms cpu, 4908-&gt;5022-&gt;2618 MB, 5025 MB goal, 8 P
</code></pre>