Celeb Glow
updates | February 26, 2026

Reproduce "no more processes" error

For academic purposes I would like to reproduce the error message "no more processes" on my bash terminal. For example:

$cp file1.txp file2.txt
bash: no more processes

How can I do that?

1

1 Answer

If you want to reproduce that error, you can probably just start a fork bomb with the first parent exiting to get you back to your shell:

You'll probably want to ensure that your system applies a process limit before doing this otherwise you might just freeze the machine rather than get a shell where you can type stuff in and have it report that you don't have anymore processes left to do anything. You'll want to check out how many processes you are using normally first to figure out what limit to set.

In FreeBSD, you'll edit /etc/login.conf and change the maxproc on default and then set it to unlimited on root.

In most Linux distros, you'll edit /etc/security/limits.conf and add a line at the bottom that looks like this: * hard nproc nnn, where nnn is the number of processes.

Then make this simple fork bomb and run it:

#include <unistd.h>
#include <stdlib.h>
int main()
{ int pid; pid = fork(); if (pid) { // parent exit(0); } else { // child while (1) { fork(); } } return 0; // we'll never get here
}

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy