-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: pathological heap trigger/goal behavior #12199
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
Comments
What drives the heap goal down must be poor estimation of heap_reachable, since this is really all the goal is based on. The goal first goes haywire after the long GC cycle at ~2.2s caused by a low trigger; that gives the mutator a lot of time to allocate during the cycle (in fact, you can see how much it allocates during the cycle), and all of that allocation gets subtracted from the marked heap size before computing the goal of the next cycle. This doesn't explain why the trigger first drops so low in the cycle at 2.2s. |
Probably too late for Go 1.6. |
This turns out to be because heap_live was underestimating the true live heap size. In this case, it was seriously underestimating it. Since the triggering and pacing is based on heap_live, this underestimation lead to the erratic behavior. (I discovered this while debugging #13535, which turns out to be closely related.) |
CL https://golang.org/cl/17748 mentions this issue. |
While trying to write a good demonstration of the GC pacer, I managed to write something that drives the heap trigger and goal much too low (and sometimes drives the goal below the trigger): https://gist.github.com/aclements/fe5d9d0fdada390c2bb0
Despite this, the final heap size in each cycle is perfectly reasonable throughout the benchmark, though it's clearly slightly less controlled once the trigger and goal get out of whack.
/cc @RLH
The text was updated successfully, but these errors were encountered: