Skip to content
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: miscalculating the memoryLimitGoal in gcPaceScavenger #62449

Closed
newacorn opened this issue Sep 5, 2023 · 1 comment
Closed

runtime: miscalculating the memoryLimitGoal in gcPaceScavenger #62449

newacorn opened this issue Sep 5, 2023 · 1 comment
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@newacorn
Copy link

newacorn commented Sep 5, 2023

What version of Go are you using (go version)?

$ go version
go version go1.20.5 darwin/amd64

Does this issue reproduce with the latest release?

YES

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/acorn/Library/Caches/go-build"
GOENV="/Users/acorn/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/acorn/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/acorn/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/acorn/workspace/programming/source/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/acorn/workspace/programming/source/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.20.5"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1p/k1k9wy1x207gwlt97mw462cc0000gn/T/go-build1067798945=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

What did you expect to see?

// We want to target retaining (100-reduceExtraPercent)% of the heap.
memoryLimitGoal := uint64(float64(memoryLimit) * (100.0 - reduceExtraPercent)/100.0)

What did you see instead?

// We want to target retaining (100-reduceExtraPercent)% of the heap.
memoryLimitGoal := uint64(float64(memoryLimit) * (100.0 - reduceExtraPercent))
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Sep 5, 2023
@panjf2000 panjf2000 added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 5, 2023
@panjf2000 panjf2000 added this to the Go1.22 milestone Sep 5, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/525555 mentions this issue: runtime: fix the miscalculation of memoryLimitGoal in gcPaceScavenger

@panjf2000 panjf2000 changed the title runtime:runtime/mgcscavenge.go on caculating memoryLimitGoal may missing a percent sign? runtime: miscalculating the memoryLimitGoal in gcPaceScavenger Sep 5, 2023
@mknyszek mknyszek moved this to In Progress in Go Compiler / Runtime Sep 6, 2023
@mknyszek mknyszek self-assigned this Sep 6, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Go Compiler / Runtime Sep 6, 2023
@golang golang locked and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants