Gophers -

Trying to learn Go (I'm a hobbyist) and have a fundamental net/http 
question. I have a web server running with a web page set to refresh every 
2 seconds. I have 3 different browsers making webserver GET requests. Each 
browser's refresh is spinning up a new goroutine on the server, right? And 
that leaves the preceding goroutine started by that browser's GET 
dead/unused going forward, right?

I'm watching the memory usage of the webserver and it is steadily 
increasing though it does seem to level off after a while.

Is the GC taking care of removing the unused goroutines and that is why I'm 
seeing the memory use increases start to level off? If I stop all the 
browsers would the GC gobble up all the now-useless goroutines and memory 
use for the webserver would drop back to nominal? At one point when I was 
tracking down one race condition (out of 839 reported), the race output 
showed "goroutine #29316". Good grief! I fixed all the race conditions 
reported.

If I set the page refreshes to a larger number, such as 5 minutes, would 
the GC gobble up the unused goroutines fast enough that I wouldn't see much 
increase in memory use?

Or am I thinking about this all wrong?

TIA,

Bucky

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d2903306-e0b0-4e7e-a035-ff14b3c64c52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to