-
Notifications
You must be signed in to change notification settings - Fork 18k
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: runtime.GC() does not trigger GC if GOGC=off #22023
Comments
Change https://golang.org/cl/65994 mentions this issue: |
The work around would be to set GOGC to some number large enough to exhaust
the machine's resources. This would have the same impact as GOGC=off.
…On Mon, Sep 25, 2017 at 3:20 PM, GopherBot ***@***.***> wrote:
Change https://golang.org/cl/65994 mentions this issue: runtime: make
runtime.GC() trigger GC even if GOGC=off
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22023 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA7Wn9NG2vx_Y-tMiu2H9oL-VVLjb4gwks5sl_0HgaJpZM4PjLzA>
.
|
Re-opening for cherry-pick to 1.9 |
CL 65994 OK for Go 1.9.2. |
Change https://golang.org/cl/70979 mentions this issue: |
…GOGC=off Currently, the priority of checks in (gcTrigger).test() puts the gcpercent<0 test above gcTriggerCycle, which is used for runtime.GC(). This is an unintentional change from 1.8 and before, where runtime.GC() triggered a GC even if GOGC=off. Fix this by rearranging the priority so the gcTriggerCycle test executes even if gcpercent < 0. Fixes #22023. Change-Id: I109328d7b643b6824eb9d79061a9e775f0149575 Reviewed-on: https://go-review.googlesource.com/65994 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org> Reviewed-on: https://go-review.googlesource.com/70979 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Austin Clements <austin@google.com>
go1.9.2 has been packaged and includes: The release is posted at golang.org/dl. — golang.org/x/build/cmd/releasebot, Oct 26 21:09:17 UTC |
What version of Go are you using (
go version
)?go version go1.9 linux/amd64
Also happens on master.
What did you do?
Attempt to manually trigger a GC using
runtime.GC()
while GOGC is set to off:https://play.golang.org/p/vB6-urJJ7M
What did you expect to see?
The GC should run.
What did you see instead?
The GC does not run.
This is a regression from 1.8 caused by my rewrite of
gcShouldStart
into(gcTrigger).test
. I've marked this for Go 1.9.1. I'm not sure how important it is, but it's also easy to fix./cc @RLH
The text was updated successfully, but these errors were encountered: