time.After and memory leaks (#76)
Official 100go entry on timer allocation and cancellation pitfalls when `time.After` is used repeatedly.
Official 100go entry on timer allocation and cancellation pitfalls when time.After is used repeatedly.
- Author: Teiva Harsanyi
- Authority: community
- Kind: guide
- URL: https://100go.co/#timeafter-and-memory-leaks-76
What it covers
- timer lifecycle
- timeout loops
- stopping or draining timers
Why authoritative
Official 100go website entry for this specific mistake.
Use when
- can time.After leak in Go
- should I use NewTimer instead of time.After
- how should timeout loops be written in Go
Keywords
- time.After, timers, memory leaks, select, timeouts