# macOS: -bash: fork: Resource temporarily unavailable (process limit reached)

**Code:** `fork: Resource temporarily unavailable` · **Category:** macOS · **Seen on:** macOS

The user hit the maximum number of processes (`kern.maxprocperuid`) — usually a fork bomb or runaway child processes.

## Meaning

Kill runaway processes (`killall -9 name`, or `pkill`), check counts with `ps -ax | wc -l`, and raise limits only if justified (`sudo sysctl kern.maxprocperuid`, `ulimit -u`). Typical triggers: infinite loops spawning subprocesses, zombie processes, test runners.

## Common causes

- Fork bomb or loop spawning processes
- Zombie processes accumulating
- Low per-user process limit
- Tool spawning too many workers
- Multiple IDE/test watchers

## Quick fix

1. Kill the offender: `killall -9 name`
2. `ps -axo pid,ppid,comm | sort -k2 | uniq -c | sort -rn | head`
3. Raise `ulimit -u` temporarily if needed

## Detailed fix by platform

### macOS

1. `sysctl kern.maxproc kern.maxprocperuid && ps -ax | wc -l`

## How to diagnose

1. **Count** — Processes vs limit?
2. **Source** — Which command spawns?
3. **Zombies** — Present?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/macos/fork-resource-temporarily-unavailable)
