aboutsummaryrefslogtreecommitdiff
path: root/test/init1.go
diff options
context:
space:
mode:
authorRick Hudson <rlh@golang.org>2015-01-06 14:58:49 -0500
committerRick Hudson <rlh@golang.org>2015-01-08 20:34:56 +0000
commitdb7fd1c1420d5ef2f874f40c0349b35007568c77 (patch)
treee5c38df7086b33171331ce9bea70555fdade564a /test/init1.go
parentf21ee1e1d8a70abd130d0435eb1a1d2e95c88129 (diff)
downloadgo-db7fd1c1420d5ef2f874f40c0349b35007568c77.tar.gz
go-db7fd1c1420d5ef2f874f40c0349b35007568c77.zip
runtime: increase GC concurrency.
run GC in its own background goroutine making the caller runnable if resources are available. This is critical in single goroutine applications. Allow goroutines that allocate a lot to help out the GC and in doing so throttle their own allocation. Adjust test so that it only detects that a GC is run during init calls and not whether the GC is memory efficient. Memory efficiency work will happen later in 1.5. Change-Id: I4306f5e377bb47c69bda1aedba66164f12b20c2b Reviewed-on: https://go-review.googlesource.com/2349 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'test/init1.go')
-rw-r--r--test/init1.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/init1.go b/test/init1.go
index f6eda6edfe..83e9149f4c 100644
--- a/test/init1.go
+++ b/test/init1.go
@@ -31,7 +31,7 @@ func init() {
}
runtime.ReadMemStats(memstats)
sys1 := memstats.Sys
- if sys1-sys > chunk*50 {
+ if sys1-sys > chunk*500 {
println("allocated 1000 chunks of", chunk, "and used ", sys1-sys, "memory")
panic("init1")
}