]> Cypherpunks repositories - gostls13.git/commitdiff
internal/trace/v2: halve the memory footprint of TestGCStress
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 9 Apr 2024 03:09:34 +0000 (03:09 +0000)
committerMichael Knyszek <mknyszek@google.com>
Wed, 10 Apr 2024 18:53:01 +0000 (18:53 +0000)
This test has been OOMing on 32-bit platforms for a bit. I suspect the
very high allocation rate is causing the program to outrun the GC in
some corner-case scenarios, especially on 32-bit Windows.

I don't have a strong grasp of what's going on yet, but lowering the
memory footprint should help with the flakiness. This shouldn't
represent a loss in test coverage, since we're still allocating and
assisting plenty (tracing the latter is a strong reason this test
exists).

For #66624.

Change-Id: Idd832cfc5cde04701386919df4490f201c71130a
Reviewed-on: https://go-review.googlesource.com/c/go/+/577475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>

src/internal/trace/v2/testdata/testprog/gc-stress.go

index 017f7f07bff3ee32befb423c4130a4b48a970837..e56245bb8fb09d9bcff27869f76f1e2feb413bc4 100644 (file)
@@ -38,16 +38,16 @@ func makeTree(depth int) *node {
 }
 
 var trees [16]*node
-var ballast *[16]*[8192]*node
+var ballast *[16]*[1024]*node
 var sink [][]byte
 
 func main() {
        for i := range trees {
                trees[i] = makeTree(6)
        }
-       ballast = new([16]*[8192]*node)
+       ballast = new([16]*[1024]*node)
        for i := range ballast {
-               ballast[i] = new([8192]*node)
+               ballast[i] = new([1024]*node)
                for j := range ballast[i] {
                        ballast[i][j] = &node{
                                data: [128]byte{1, 2, 3, 4},