From: Michael Anthony Knyszek Date: Tue, 14 Nov 2023 15:36:39 +0000 (+0000) Subject: internal/trace/v2: halve the memory footprint of the gc-stress test X-Git-Tag: go1.22rc1~331 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=859c13a5ad80308125c79521cfc047200fd5a512;p=gostls13.git internal/trace/v2: halve the memory footprint of the gc-stress test An out-of-memory error in this test has been observed on 32-bit platforms, so halve the memory footprint of the test. Also halve the size of steady-state allocation rate in bytes. The end result should be approximately the same GC CPU load but at half the memory usage. Change-Id: I2c2d335da7dc4c5c58cb9d92b6e5a4ece55d24a8 Reviewed-on: https://go-review.googlesource.com/c/go/+/542215 Auto-Submit: Michael Knyszek LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt --- diff --git a/src/internal/trace/v2/testdata/testprog/gc-stress.go b/src/internal/trace/v2/testdata/testprog/gc-stress.go index 7a1fdfdfe1..70d3a246c3 100644 --- a/src/internal/trace/v2/testdata/testprog/gc-stress.go +++ b/src/internal/trace/v2/testdata/testprog/gc-stress.go @@ -37,15 +37,15 @@ func makeTree(depth int) *node { } } -var trees [32]*node -var ballast *[32]*[8192]*node +var trees [16]*node +var ballast *[16]*[8192]*node var sink []byte func main() { for i := range trees { trees[i] = makeTree(6) } - ballast = new([32]*[8192]*node) + ballast = new([16]*[8192]*node) for i := range ballast { ballast[i] = new([8192]*node) for j := range ballast[i] { @@ -57,7 +57,7 @@ func main() { for i := 0; i < runtime.GOMAXPROCS(-1); i++ { go func() { for { - sink = make([]byte, rand.Intn(65536)) + sink = make([]byte, rand.Intn(32<<10)) } }() }