1 // $G $D/$F.go && $L $F.$A && ./$A.out
3 // Copyright 2010 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.
11 func sender(c chan int, n int) {
12 for i := 0; i < n; i++ {
17 func receiver(c, dummy chan int, n int) {
18 for i := 0; i < n; i++ {
29 runtime.MemProfileRate = 0
32 dummy := make(chan int)
36 receiver(c, dummy, 100000)
38 runtime.MemStats.Alloc = 0
40 // second time shouldn't increase footprint by much
42 receiver(c, dummy, 100000)
45 if runtime.MemStats.Alloc > 1e5 {
46 println("BUG: too much memory for 100,000 selects:", runtime.MemStats.Alloc)