Created
June 16, 2026 15:27
-
-
Save aj07mm/f306270348104eaa37d5fd54fec55f4c to your computer and use it in GitHub Desktop.
cpu_kamikaze.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import multiprocessing | |
| import os | |
| import time | |
| def memory_and_cpu_bomb(): | |
| """Pin the CPU core to 100% AND aggressively flood RAM. | |
| This creates an infinite list of numbers that grows exponentially.""" | |
| print(f"🚀 Core Worker PID {os.getpid()} ignited. Maxing out CPU and eating RAM...") | |
| container = [] | |
| # No sleep, infinite loop, rapid memory expansion | |
| while True: | |
| # 1. Do heavy math to peg the CPU core at 100% | |
| _ = 999999 * 999999 | |
| # 2. Append massive blocks of data to RAM to force the crash | |
| # This expands the list by 1 million items on every single iteration | |
| container.extend(list(range(1_000_000))) | |
| if __name__ == "__main__": | |
| # Detect your exact core count | |
| NUM_CORES = os.cpu_count() or 10 | |
| print("=" * 60) | |
| print(f"⚠️ WARNING: PREPARING 10-CORE HARD CRASH TEST (Cores: {NUM_CORES}) ⚠️") | |
| print("This script WILL crash your Python instance within seconds.") | |
| print("Your mouse/UI may freeze briefly right before the crash.") | |
| print("=" * 60) | |
| input("Press ENTER if you are ready to execute the crash...") | |
| active_processes = [] | |
| # Launch 1 heavy bomb process per physical CPU core | |
| for i in range(NUM_CORES): | |
| p = multiprocessing.Process(target=memory_and_cpu_bomb) | |
| p.start() | |
| active_processes.append(p) | |
| # Keep the main process waiting for them to die | |
| for p in active_processes: | |
| p.join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment