Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

channels leak mach ports on darwin #503

Closed
gopherbot opened this issue Jan 8, 2010 · 2 comments
Closed

channels leak mach ports on darwin #503

gopherbot opened this issue Jan 8, 2010 · 2 comments

Comments

@gopherbot
Copy link
Contributor

by runningwild:

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

Attachments:

  1. foo.go (75 bytes)
@rsc
Copy link
Contributor

rsc commented Feb 7, 2010

Comment 1:

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.

Owner changed to r...@golang.org.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Feb 9, 2010

Comment 2:

This issue was closed by revision 62d627f.

Status changed to Fixed.

Merged into issue #-.

@gopherbot gopherbot added the fixed label Feb 9, 2010
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants