proposal: runtime/debug: user-configurable memory target #44309
User-configurable memory target
Author: Michael Knyszek
Issue #23044 proposed the addition of some kind of API to provide a "minimum heap" size; that is, the minimum heap goal that the GC would ever set. The purpose of a minimum heap size, as explored in that proposal, is as a performance optimization: by preventing the heap from shrinking, each GC cycle will get longer as the live heap shrinks further beyond the minimum. Today, this performance optimization is achieved using a heap ballast.
This proposal builds on #44167 as it resolves key issues with the pacer that blocked consideration of #23044. The core proposal in #23044 is now straightforward to implement. The only thing we need is evidence that it actually will work, a justification for the new "knob," and a concrete API.
The biggest risk of this proposal is the introduction of a new "GC knob," as that may lead to an explosion in the number of possible GC configurations. Testing and maintaining all of them is very difficult, and other GCs just give up and only support a small subset of configurations. I believe that my API formulation bounds the number of possible GC configurations, and my implementation plans for #44167 (that is, making the pacer in the runtime testable) limit this risks of having many more potential GC configurations enough to be worth it. That isn't to say we shouldn't be judicious of adding new GC knobs going forward, but this is one that has shown to be a clear user need over the years.
Credit goes to @cespare for proposing this in the first place.
The text was updated successfully, but these errors were encountered:
I have reviewed the design proposal. From an overall reasoning, ecosystem and production fitness perspective, and most specifically a process execution plan standpoint, I support it and think it is sound. Thank you for all of the hard work you've put into it.
Can't wait to see what you folks come up with on the other efforts this dovetails!
For golang/go#44309. Change-Id: Ibd2f9bed3a1a1da40b5a3d216ccb1f48c9b64c04 Reviewed-on: https://go-review.googlesource.com/c/proposal/+/292789 Reviewed-by: Michael Pratt <email@example.com>