You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
Compile and run the attached program, foo.go, then view with top.
What is the expected output? What do you see instead?
Expected to see top output saying something that remains constant, instead got this:
PID COMMAND %CPU TIME #TH #WQ #PORTS #MREG RPRVT RSHRD RSIZE
VPRVT
52479 foo 97.9 00:02.66 3/1 0 26543+ 21 668K 240K 852K 14M
With #PORTS at 26k and increasing at the rate of 10k per second or so.
What is your $GOOS? $GOARCH?
GOOS=darwin
GOARCH=amd64 and 386
Which revision are you using? (hg identify)
ed4677dbdbbc tip
Due to changes in the channel implementation it's a little harder to trigger this now.
New test program:
package main
import "runtime"
func send(c chan int) {
c <- 1
}
func main() {
runtime.GOMAXPROCS(2)
for {
c := make(chan int, 4)
go send(c)
go send(c)
go send(c)
<-c
<-c
<-c
}
}
I tried adding a finalizer on the chan but it appears that most channels are not being
garbage collected at all - the memory usage grows without bound too.
by runningwild:
Attachments:
The text was updated successfully, but these errors were encountered: