3 // Copyright 2011 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Test that goroutines and garbage collection run during init.
21 memstats
:= new(runtime
.MemStats
)
22 runtime
.ReadMemStats(memstats
)
24 b
:= make([]byte, chunk
)
26 b
[i
] = byte(i%10
+ '0')
29 for i
:= 0; i
< 1000; i
++ {
32 runtime
.ReadMemStats(memstats
)
34 if sys1
-sys
> chunk
*50 {
35 println("allocated 1000 chunks of", chunk
, "and used ", sys1
-sys
, "memory")
40 func send(c
chan int) {