# goroutine 泄漏: N 个 goroutine 阻塞在 chan send（通过 pprof 检测）

- **ID:** `go/goroutine-leak-blocked-send`
- **领域:** go
- **类别:** resource_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

启动的 goroutine 向无缓冲或已满的 channel 发送数据，但接收方已停止读取，导致它们永久阻塞并不断累积。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.0+ | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   select {
case ch <- v:
case <-ctx.Done():
    return
}
   ```
2. **** (90% 成功率)
   ```
   jobs := make(chan Job, 128)
for i := 0; i < runtime.NumCPU(); i++ {
    go func() { for j := range jobs { process(j) } }()
}
   ```

## 无效尝试

- **** — Blocked goroutines are not CPU-bound; more CPUs do not unblock them and memory keeps growing. (95% 失败率)
- **** — GC does not collect goroutines blocked on channels; they remain reachable from the scheduler. (90% 失败率)
