mirror of
https://github.com/golang/go
synced 2024-11-14 17:20:21 -07:00
internal/trace/v2: halve the memory footprint of TestGCStress
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>
This commit is contained in:
parent
5bba5b256c
commit
3504da4565
@ -38,16 +38,16 @@ func makeTree(depth int) *node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var trees [16]*node
|
var trees [16]*node
|
||||||
var ballast *[16]*[8192]*node
|
var ballast *[16]*[1024]*node
|
||||||
var sink [][]byte
|
var sink [][]byte
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
for i := range trees {
|
for i := range trees {
|
||||||
trees[i] = makeTree(6)
|
trees[i] = makeTree(6)
|
||||||
}
|
}
|
||||||
ballast = new([16]*[8192]*node)
|
ballast = new([16]*[1024]*node)
|
||||||
for i := range ballast {
|
for i := range ballast {
|
||||||
ballast[i] = new([8192]*node)
|
ballast[i] = new([1024]*node)
|
||||||
for j := range ballast[i] {
|
for j := range ballast[i] {
|
||||||
ballast[i][j] = &node{
|
ballast[i][j] = &node{
|
||||||
data: [128]byte{1, 2, 3, 4},
|
data: [128]byte{1, 2, 3, 4},
|
||||||
|
Loading…
Reference in New Issue
Block a user