<p dir="auto">by <strong>shon.feder</strong>:</p>
<pre class="notranslate">This issue was already raised here:
<a href="https://golang.org/issue/3733&amp;" rel="nofollow">https://golang.org/issue/3733&amp;</a>;can=1&amp;q=Writing%20Web%20Applications&amp;colspec=ID%20Status%20Stars%20Priority%20Owner%20Reporter%20Summary

However, it persists though that ticket has been marked as 'fixed'.

- In the section "Handling Non-Existent Pages
(<a href="http://golang.org/doc/articles/wiki/#tmp_7)" rel="nofollow">http://golang.org/doc/articles/wiki/#tmp_7)</a>, the second line of the example code for
viewHandler() reads `title, err := getTitle(w, r)`.  However, getTitle() isn't
introduced until the section on "validation", at which point the learner is
instructed to add it to viewHandler().

Hope this is helpful and not-pestering. Thanks very much for all of youall's help and
work on this project.  It's been great fun learning go.</pre>
<p dir="auto">I'm looking for a way to limit the max memory consumption of a Go program, say the memory doesn't exceed X. Further discussion is <a href="https://plus.google.com/+OwenOu/posts/B8WqDGvR1cf" rel="nofollow">here</a>.</p>
<p dir="auto">Does it make sense to make <a href="https://github.com/golang/go/blob/release-branch.go1.4/src/runtime/malloc.h#L152"><code class="notranslate">runtime.MaxMem</code></a> configurable?</p>
<ol dir="auto">
<li>What version of Go are you using (go version)?<br>
1.4.1.</li>
<li>What operating system and processor architecture are you using?<br>
64 bit Linux.</li>
<li>What did you do?<br>
I tried to limit the memory usage of my Go program. The server only has 1GB. The Go process was killed by the monitor process and the server was restarted.</li>
<li>What did you expect to see?<br>
I expect there's a variable in Go runtime to set this limit, e.g., <code class="notranslate">runtime.MaxMem = x</code>.</li>
<li>What did you see instead?<br>
I couldn't find a way to limit memory usage in Go. <code class="notranslate">ulimit</code> may be one option but it's not cross platform. Also <code class="notranslate">ulimit</code> requires root access and I don't have it since the server is hosted on Heroku.</li>
</ol>
<p dir="auto">/cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/davecheney/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/davecheney">@davecheney</a></p>