# RuntimeError: DataLoader worker (pid 12345) received signal 9 (SIGKILL). Possible causes: out of memory or system limit reached.

- **ID:** `pytorch/dataloader-num-workers-memory-leak`
- **Domain:** pytorch
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Too many DataLoader workers with high memory usage per sample cause the system OOM killer to terminate workers, especially when using large datasets or high-resolution images.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.10 | active | — | — |
| 1.11 | active | — | — |
| 1.12 | active | — | — |
| 1.13 | active | — | — |
| 2.0 | active | — | — |
| 2.1 | active | — | — |
| 2.2 | active | — | — |
| 2.3 | active | — | — |

## Workarounds

1. **Reduce num_workers to a lower value, e.g., 2 or 4, or set to 0 for single-process loading to eliminate worker memory overhead.** (90% success)
   ```
   Reduce num_workers to a lower value, e.g., 2 or 4, or set to 0 for single-process loading to eliminate worker memory overhead.
   ```
2. **Use prefetch_factor to limit the number of batches prefetched per worker, reducing peak memory usage.** (75% success)
   ```
   Use prefetch_factor to limit the number of batches prefetched per worker, reducing peak memory usage.
   ```

## Dead Ends

- **** — Increasing workers exacerbates memory pressure, causing more frequent OOM kills. (70% fail)
- **** — This doesn't reduce per-worker memory; it just changes how data is split. (50% fail)
