Open
Description
- What version of Go are you using (
go version
)?
1.5.3, 1.6 - What operating system and processor architecture are you using (
go env
)?
x86_64 - OSX and Linux - What did you do?
Any golang program will create a new OS thread when it needs to if things are blocked. But these threads aren't ever destroyed. For example, a program using 7 goroutines might have 40+ OS threads hanging around. The numbers will surely get much higher as traffic fluctuates against a golang server process throughout the day. - What did you expect to see?
Once an OS thread has been idle long enough, I would have expected it to be destroyed. Being recreated if needed. Expanding and contracting like the relationship between the heap and GC. - What did you see instead?
The many OS threads that were created hang around even with an idle program and very few goroutines.
After doing some reading into other (closed) issues on this repo dating back to 2012 - including the one where SetMaxThreads
was introduced - I'm curious, why keep the OS threads around instead of cleaning them up?