Troubleshooting
Git error unable to create thread Resource temporarily unavailable
The error "unable to create thread: Resource temporarily unavailable" means the system could not create another thread. On its own it does not distinguish between memory, a process or thread limit, ulimit or another resource.
Keep the full command, output and time. Check the version and the existing configuration and correlate the failure with PMEM, NPROC and the Resource Usage snapshots:
git --version git config --show-origin --get-regexp '^pack\.' ulimit -u
If it happens during pack-objects, repeat the same subcommand once, limiting threads and window for that run:
git -c pack.threads=1 -c pack.windowMemory=100m SUBCOMANDO
For index-pack, limit only the threads:
git -c pack.threads=1 SUBCOMANDO
If the test solves it and you need to keep the setting, apply it only to the repository:
git config --local pack.threads 1 git config --local pack.windowMemory 100m
Do not set pack.packSizeLimit for this error: it limits the size of each pack file, not thread creation, and can produce larger, slower repositories. Avoid --global unless you have shown that every operation on the account needs it. If it fails even with one thread, contact support with the time, command and metrics.
Scope and reverting the setting
Replace SUBCOMANDO with the actual operation and its arguments; it is a placeholder, not a Git subcommand. Before saving a local option, note whether it already existed and its value. After the test, restore it; if it did not exist before, remove only that local option.
pack.windowMemory limits the window used to search for deltas, not all of Git's memory. Reducing threads may increase the run time and does not guarantee getting past a process limit already taken up by other tasks. If the error appears with the remote: prefix, check whether the remote server is generating it: the local configuration does not change its environment.
You may also find useful
- "An error occurred while sending the message" in the PrestaShop contact form Diagnose the contact form rejection and fix an old override only when it does not send contactform's...
- 404 errors on static files slow down browsing Detect missing static resources that trigger PHP and use CPU, serve them as lightweight 404s and gui...
- Composer installs a global package but cannot find its command Check that the global Composer binary exists, get its real directory and add it to PATH only when th...
- Debug errors in Joomla Get Joomla's exact error with its named reporting levels, without using numeric masks that depend on...
Something wrong or out of date? Tell us and we will review it.