You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Doing a large amount of fetch requests results in a memory leak #20912
Doing a very large amount of fetch requests results in a memory leak. Noticed this while working on my web crawler — after ~3 minutes of running (~9.5k requests), bun crashes due to a memory leak. This has also happened in previous versions and other projects that use a lot of fetch requests.
I'm guessing Bun is storing the full response body in memory, even though it should be collected by the garbage collector. No, it's not a memory leak in my code.
Relevant log output
Bun v1.2.18 (0d4089ea) macOS Silicon
macOS v26.0
CPU: fp aes crc32 atomics
Args: "bun""."
Features: fetch(9497) jsc transpiler_cache(64) workers_spawned(64)
Builtins: "bun:main""bun:sqlite"
Elapsed: 189710ms | User: 223359ms | Sys: 142958ms
RSS: 2.46GB | Peak: 2.46GB | Commit: 0.02ZB | Faults: 121
panic: Segmentation fault at address 0x7FE037DFA4FD3E8
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,please file a GitHub issue using the link below: https://bun.report/1.2.18/Ma10d4089eiBggkQ_uqq8fuqq8fmvs8f+3xvR2o5gO__A263h4/Hxh2g2Fzsh: trace trap bun .
Stack Trace (bun.report)
Bun v1.2.18 (0d4089e) on macos aarch64 [RunCommand]
@tiagozip We have been dealing with various memory issues in our Bun server. I have been going through Bun memory issues to pattern match for our setup. We run tons of fetch requests in our server (to S3, LLM APIs, etc.). I am just curious: does this issue still repro for you on the latest Bun? It was reported 5 months ago, I figure there's a chance it's been resolved. Thanks!
Activity
fitzn commentedon Dec 9, 2025
@tiagozip We have been dealing with various memory issues in our Bun server. I have been going through Bun memory issues to pattern match for our setup. We run tons of
fetchrequests in our server (to S3, LLM APIs, etc.). I am just curious: does this issue still repro for you on the latest Bun? It was reported 5 months ago, I figure there's a chance it's been resolved. Thanks!jotka commentedon Feb 21, 2026
@fitzn issue is still present in 1.3.9