starts a ticker then closes the goroutines down again in an orderly fashion
It sleeps at the end so you can run top or equivalent. If you do you'll
see it using a lot of CPU at this point. kill the process with -QUIT
and you'll find that this is the only goroutine of significance running.
goroutine 100005 [running]:
/usr/local/go/src/runtime/time.go:265 +0xbf fp=0xc21641a768 sp=0xc21641a718
/usr/local/go/src/runtime/time.go:172 +0x1cb fp=0xc21641a7e0
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc21641a7e8
created by runtime.addtimerLocked
It appears that all those tickers got leaked and the code is spending
all the CPU keeping them up to date.
Naively I was expecting that once the goroutines returned they would be
garbage collected but that doesn't appear to be the case.
This is easy to fix of course (with NewTicker and Stop()), but is it
expected that the tickers aren't garbage collected?
Nick Craig-Wood <email@example.com> -- http://www.craig-wood.com/nick
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 firstname.lastname@example.org.
For more options, visit https://groups.google.com/d/optout.