aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorJoel Sing <jsing@google.com>2015-10-01 22:34:48 +1000
committerJoel Sing <jsing@google.com>2015-10-01 18:00:55 +0000
commitdb70c019d7175de54583f99a38016f4ff7bb5eba (patch)
treefef3c12e8ab4df61e59eeb34439d7ee9f0bc5673 /src/runtime
parent1d5251f707af711720cbd92891a1d62b89c15977 (diff)
downloadgo-db70c019d7175de54583f99a38016f4ff7bb5eba.tar.xz
runtime/trace: reduce memory usage for trace stress tests on openbsd/arm
Reduce allocation to avoid running out of memory on the openbsd/arm builder, until issue/12032 is resolved. Update issue #12032 Change-Id: Ibd513829ffdbd0db6cd86a0a5409934336131156 Reviewed-on: https://go-review.googlesource.com/15242 Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/trace/trace_test.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/runtime/trace/trace_test.go b/src/runtime/trace/trace_test.go
index 0a8957ffdf..f4791c2548 100644
--- a/src/runtime/trace/trace_test.go
+++ b/src/runtime/trace/trace_test.go
@@ -129,7 +129,13 @@ func TestTraceStress(t *testing.T) {
runtime.GC()
// Trigger GC from malloc.
- for i := 0; i < 1e3; i++ {
+ n := int(1e3)
+ if runtime.GOOS == "openbsd" && runtime.GOARCH == "arm" {
+ // Reduce allocation to avoid running out of
+ // memory on the builder - see issue/12032.
+ n = 512
+ }
+ for i := 0; i < n; i++ {
_ = make([]byte, 1<<20)
}
@@ -260,7 +266,13 @@ func TestTraceStressStartStop(t *testing.T) {
runtime.GC()
// Trigger GC from malloc.
- for i := 0; i < 1e3; i++ {
+ n := int(1e3)
+ if runtime.GOOS == "openbsd" && runtime.GOARCH == "arm" {
+ // Reduce allocation to avoid running out of
+ // memory on the builder - see issue/12032.
+ n = 512
+ }
+ for i := 0; i < n; i++ {
_ = make([]byte, 1<<20)
}