Java code
import java.util.concurrent.*;
public class EndlessThreads {
    public static void main(String[] args) {
        
        ExecutorService executorService = Executors.newCachedThreadPool();
        
        while (true) {
            executorService.execute(new Runnable() {
                public void run() {
                    //Crash the system
                }
            });
        }
    }
}
Bash
while true do for i in {1..100} do echo “Processing thread $i” /bin/bash & done done
            