blog icon indicating copy to clipboard operation
blog copied to clipboard

posts/go/go-tips-timer-memory/

Open utterances-bot opened this issue 3 years ago • 2 comments

Go 内存泄露之痛,这篇把 Go timer.After 问题根因讲透了!

https://eddycjy.com/posts/go/go-tips-timer-memory/

utterances-bot avatar Apr 09 '21 02:04 utterances-bot

最后的修改方法中,NewTimer需要Reset吧,否则只触发一次 。或者改成NewTicker。

NAND86 avatar Apr 09 '21 02:04 NAND86

NewTimer 会造成死锁,换成NewTicker。

zzhzero avatar Apr 23 '21 15:04 zzhzero