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/trace: NextGC is 0 if no GC was triggered during the trace #52517

Closed
WangLeonard opened this issue Apr 24, 2022 · 2 comments
Closed

runtime/trace: NextGC is 0 if no GC was triggered during the trace #52517

WangLeonard opened this issue Apr 24, 2022 · 2 comments
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

@WangLeonard
Copy link
Contributor

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

$ go version
go version devel go1.19-7d48c32412 Wed Apr 13 21:11:38 2022 +0800 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

What did you do?

package main

import (
	"os"
	"runtime"
	"runtime/trace"
)

var global interface{}

func init() {
	global = make([]interface{}, 100000000)
}

var global2 []interface{}

func main() {
	runtime.GC()
	var f, _ = os.Create("trace1.out")
	trace.Start(f)
	for i := 0; i < 10000; i++ {
		global2 = append(global2, make([]int, 100))
	}
	trace.Stop()

	global2 = nil

	var f2, _ = os.Create("trace2.out")
	trace.Start(f2)
	runtime.GC()
	for i := 0; i < 10000; i++ {
		global2 = append(global2, make([]int, 100))
	}
	trace.Stop()
	global2 = nil
}


// go tool trace -http=127.0.0.1:8082 ./trace1.out
// go tool trace -http=127.0.0.1:8083 ./trace2.out

What did you expect to see?

image

image

What did you see instead?

image

image

@gopherbot
Copy link

Change https://go.dev/cl/401777 mentions this issue: runtime/trace: fix NextGC display

@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 27, 2022
@cagedmantis cagedmantis added this to the Backlog milestone Apr 27, 2022
@cagedmantis
Copy link
Contributor

/cc @golang/runtime

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Mar 16, 2023
@dmitshur dmitshur modified the milestones: Backlog, Go1.21 Mar 16, 2023
@golang golang locked and limited conversation to collaborators Mar 15, 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