-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: make max heap size configurable #9849
Comments
The issue tracker isn't a support forum. Please move this to golang-nuts@ or StackOverflow. The answer will probably be ulimit. |
This is not a supporting question. It's a feature request... |
And |
Fair enough, I suppose. Although I'm not sure how much Go should try to be your operating system, as opposed to just recognizing and respecting the limits you've put on the process in your operating system. Will reopen. |
@bradfitz I think it would be worth writing a CONTRIBUTING guide here in GitHub so that its link shows up every time anybody is about to create a new issue. https://github.com/blog/1184-contributing-guidelines |
@c4milo, we already did: https://github.com/golang/go/blob/master/CONTRIBUTING.md |
Clueless me. Sorry. |
I added more description. However, I don't think the confusion was caused by not having filled the issue template. |
Actually the issue is much better now, thanks. |
See also: #5049 (runtime: respect memory ulimit more precisely). |
Adding knobs like this can certainly seem attractive but they come with costs in the development cycle. A simple binary knob doubles the number of tests that the Go runtime team has to run. We run those tests a dozen times a day and leave them running every night when we go home. Each CL runs them across more than a dozen HW/OS configurations. This request suggests a non-binary knob where reasonable testing will require more than two values which is even worse. The bar to adding knobs in Go is, and should be, very high. |
Duplicate of #5049 |
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 here.
Does it make sense to make
runtime.MaxMem
configurable?1.4.1.
64 bit Linux.
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.
I expect there's a variable in Go runtime to set this limit, e.g.,
runtime.MaxMem = x
.I couldn't find a way to limit memory usage in Go.
ulimit
may be one option but it's not cross platform. Alsoulimit
requires root access and I don't have it since the server is hosted on Heroku./cc @davecheney
The text was updated successfully, but these errors were encountered: