You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
run strconv unit tests a few hundred times
What do you see instead?
--- FAIL: TestAppendUintDoesntAllocate-62 (0.00 seconds)
itoa_test.go:148: with local buffer, did 2 allocations, want 1
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
linux
Which version are you using? (run 'go version')
go version weekly.2012-03-27 +d9e4f47ae341
Please provide any additional information below.
GOMAXPROCS=62 if that matters.
The text was updated successfully, but these errors were encountered:
I think last time this came up, we assumed it was a GC that ran during the test being
measured, but we've already forced a GC here before measurement:
In itoa_test.go:
func numAllocations(f func()) int {
runtime.GC()
memstats := new(runtime.MemStats)
runtime.ReadMemStats(memstats)
n0 := memstats.Mallocs
f()
runtime.ReadMemStats(memstats)
return int(memstats.Mallocs - n0)
}
This is a bad way to count allocations either way.
Maybe it is memory profiling, which does its own
allocations. Package fmt's TestCountMallocs is
the right way to do it.
The text was updated successfully, but these errors were encountered: