[BUG] Claude Code spawned ~3,000 parallel bash processes in 17 seconds, causing OOM crash and hard reboot.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code spawns thousands of bash subprocesses in parallel within seconds, exhausting all system memory and triggering the kernel OOM killer. This has occurred multiple times.
~3,079 bash processes were spawned between PID 21300 and PID 24379 in approximately 17 seconds (12:38:41–12:38:58 local time). All processes were owned by UID 1000, all carried oom_score_adj:100 (set by Claude Code). The code process itself reached ~1.4 TB virtual memory allocation. Usually this results in a total lock up of the host and requires a full reboot.
What Should Happen?
Bash subprocesses are spawned sequentially or with a reasonable concurrency limit that respects system memory.
Error Messages/Logs
Kernel OOM log evidence (journalctl -b -1 -k --no-pager | grep -A 50 "Out of memory"):
Mai 25 12:38:41 <hostname> kernel: Out of memory: Killed process 5301 (code) total-vm:1463373852kB, anon-rss:200640kB, file-rss:2916kB, shmem-rss:2076kB, UID:1000 pgtables:2096kB oom_score_adj:300
Mai 25 12:38:57 <hostname> kernel: [ 21300] 1000 21300 61965 2732 2285 447 0 90112 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21301] 1000 21301 61313 2468 2023 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21303] 1000 21303 61967 2673 2226 447 0 90112 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21304] 1000 21304 61313 2475 2030 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21305] 1000 21305 61967 2705 2258 447 0 90112 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21306] 1000 21306 61314 2444 1999 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21307] 1000 21307 61314 2477 2032 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21308] 1000 21308 62001 2646 2199 447 0 90112 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21309] 1000 21309 61315 2445 2000 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21310] 1000 21310 62001 2710 2263 447 0 90112 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21311] 1000 21311 61315 2513 2036 477 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21312] 1000 21312 61316 2482 2037 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21313] 1000 21313 62002 2654 2207 447 0 90112 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21314] 1000 21314 61316 2485 2040 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21315] 1000 21315 62002 2718 2271 447 0 90112 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21316] 1000 21316 61317 2454 2009 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21317] 1000 21317 61318 2490 2045 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21318] 1000 21318 62003 2687 2240 447 0 90112 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21319] 1000 21319 61319 2458 2013 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21320] 1000 21320 62003 2751 2304 447 0 90112 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21321] 1000 21321 61319 2527 2082 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21322] 1000 21322 62004 2659 2212 447 0 90112 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21323] 1000 21323 61320 2464 2019 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21324] 1000 21324 61320 2500 2055 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21325] 1000 21325 62004 2723 2276 447 0 90112 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21326] 1000 21326 61321 2468 2023 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21327] 1000 21327 62006 2663 2216 447 0 90112 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21328] 1000 21328 61321 2536 2091 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21329] 1000 21329 62006 2727 2280 447 0 90112 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21330] 1000 21330 61322 2504 2059 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21331] 1000 21331 61322 2508 2063 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21332] 1000 21332 62007 2669 2222 447 0 90112 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21333] 1000 21333 61323 2509 2032 477 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21334] 1000 21334 62007 2733 2286 447 0 90112 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21335] 1000 21335 61358 2513 2068 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21336] 1000 21336 61358 2513 2068 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21337] 1000 21337 62008 2673 2226 447 0 90112 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21338] 1000 21338 61359 2521 2076 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21339] 1000 21339 62008 2737 2290 447 0 90112 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21340] 1000 21340 61359 2489 2044 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21341] 1000 21341 61360 2522 2077 445 0 77824 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21342] 1000 21342 62009 2677 2230 447 0 94208 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21343] 1000 21343 61360 2491 2046 445 0 77824 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21344] 1000 21344 62009 2773 2326 447 0 94208 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21345] 1000 21345 61361 2559 2114 445 0 81920 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21346] 1000 21346 62010 2682 2235 447 0 94208 1888 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21347] 1000 21347 61361 2495 2050 445 0 81920 1408 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21348] 1000 21348 61362 2531 2086 445 0 81920 1376 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21349] 1000 21349 62010 2778 2331 447 0 94208 1824 100 bash
Mai 25 12:38:57 <hostname> kernel: [ 21350] 1000 21350 61362 2500 2055 445 0 81920 1408 100 bash
--
Mai 25 12:38:58 <hostname> kernel: Out of memory: Killed process 13836 (Web Content) total-vm:2821064kB, anon-rss:7324kB, file-rss:3604kB, shmem-rss:1216kB, UID:1000 pgtables:580kB oom_score_adj:233
Steps to Reproduce
Fresh install of claude code, no changes in any settings.
This happens specifically when claude decides to read files or use the find command.
Having extracted a bash command that previously caused an issue, I can reproduce the issue by entering the prompt:
"run this bash command: find /Path/ -maxdepth 3 -type f \( -name ".tex" -name ".makefile" -o -name "Makefile" \) 2>/dev/null | head -30 && echo "---" && find /Path/-maxdepth 3 -type d | head -20)"
Where /Path/ is a working path and manual execution of the bash command works.
System info
- OS: Fedora 42
- Kernel: 6.19.14-101.fc42.x86_64
- RAM: 32 GB
- Shell: fish
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.150 (Claude Code)
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗