fork: retry: Resource temporarily unavailable 🐧 Linux

fork: retry: Resource temporarily unavailable (process/thread limit)

The user or container hit its maximum number of processes/threads (ulimit -u, pids cgroup), so new processes can’t be created.

Seen on: Linux

Meaning

Thread-heavy apps (Java, Chrome, build tools), fork bombs or leaked processes exhaust nproc/pids limits even with plenty of RAM. Containers often have a pids limit, and systemd sets TasksMax per service.

Common causes

  • User nproc limit reached (ulimit -u)
  • systemd TasksMax for the service
  • Container pids limit
  • Process/thread leak

⚡ Quick fix

  1. Count processes: ps -eLf | wc -l / ps -u user | wc -l
  2. Raise limits (limits.conf, TasksMax, --pids-limit)
  3. Fix the leak

Detailed fix by platform

Linux

  1. bash
    ulimit -u
    ps -eLf | wc -l
    systemctl show myapp -p TasksMax
    # /etc/security/limits.d/90-nproc.conf
    * soft nproc 65535

How to diagnose

  1. Count — Threads per user/service
  2. Limits — ulimit -u, TasksMax, pids.max
  3. Leak — Growing over time?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.