# fatal error: runtime: out of memory (timer leak)

- **ID:** `go/goroutine-timer-leak`
- **Domain:** go
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Creating time.Timer or time.Ticker without stopping them, causing goroutine leak and memory exhaustion.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0 | active | — | — |
| 1.20 | active | — | — |

## Workarounds

1. **Always stop timers and tickers when done** (95% success)
   ```
   ticker := time.NewTicker(time.Second)
defer ticker.Stop()
for range ticker.C {
    // do work
}
   ```
2. **Use time.After with select and timeout** (85% success)
   ```
   select {
case <-ch:
case <-time.After(5 * time.Second):
    // timeout
}
   ```

## Dead Ends

- **Using time.After repeatedly without reset** — time.After creates new timer each call; old timers are not garbage collected until fired. (90% fail)
- **Ignoring ticker stop in defer** — Ticker continues to tick; goroutine leaks. (80% fail)
