Repository navigation
Description
What version of Bun is running?
1.3.11
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
Reproduction
Create a Windows 11 x64 25H2 VM with (fixed) 6 GiB memory
Run the last version prior to the latest of Claude Code (currently integrated with Bun v1.3.11 as of Mar. 17, 2026)
Wait for the app to crash with the following stack trace during the auto update procedure.
Bun v1.3.11 ([`a2743b6`](<https://github.com/oven-sh/bun/tree/a2743b6d2a45ff76e2544fe195f92143164d3705>)) on windows x86_64_baseline [_]
Bun ran out of memory
- [`handle_oom.zig:58`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/handle_oom.zig#L58>): `handleOom`
- [`AsyncHTTP.zig:397`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/http/AsyncHTTP.zig#L397>): `onAsyncHTTPCallback`
- [`http.zig:1903`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/http.zig#L1903>): `sendProgressUpdateWithoutStageCheck`
- [`http.zig:1715`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/http.zig#L1715>): `onData`
- [`openssl.c:575`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/crypto/openssl.c#L575>): `ssl_on_data`
- [`loop.c:509`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/loop.c#L509>): `us_internal_dispatch_ready_poll`
- [`poll.c:194`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/win/poll.c#L194>): `uv__fast_poll_process_poll_req`
- [`core.c:613`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/win/core.c#L613>): `uv__process_reqs`
- [`core.c:736`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/win/core.c#L736>): `uv_run`
- [`HTTPThread.zig:534`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/http/HTTPThread.zig#L534>): `processEvents`
- [`HTTPThread.zig:227`](<https://github.com/oven-sh/bun/blob/a2743b6d2a45ff76e2544fe195f92143164d3705/src/http/HTTPThread.zig#L227>): `onStart`
Features: spawn, standalone\_executable, Bun.stderr, Bun.stdin, Bun.stdout, abort\_signal, fetch, jsc
What is the expected behavior?
The AsyncHTTP API uses 1 GiB or less memory while handing a ~250 MiB response.
What do you see instead?
The AsyncHTTP API often erroneously allocates over 2 GiB of memory and triggers an OOM crash.
Additional information
Auto-generated report link
Additional info
The AsyncHTTP API should not allocate over 1 GiB of memory to process a response of a few hundreds MiB. Please check the underlying memory allocation subroutines. The memory management in Bun (and maybe Zig) has been quite unstable and borderline unusable in production environments, especially when the RAM prices have reached the moon.
Activity
github-actions commentedon Mar 17, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
lilavaz4444 commentedon Mar 17, 2026
The issue is closely related to #27842, which got incorrectly marked as a duplicate of #22514.
Jarred-Sumner commentedon Aug 1, 2026
We were not able to run the exact Windows/Claude Code auto-update scenario, but a stand-in that downloads a 250 MiB response over
fetch(asarrayBuffer(), viaBun.write(file, response), and via a stream reader) reproduces the report on Bun 1.3.14: RSS climbs to ~2.3–2.6 GB after a handful of downloads and never comes back down. On the current 1.4.0 canary the same script peaks at ~540–570 MB while a 250 MiB body is buffered and returns to ~55–70 MB after each streamed download, with no growth across iterations. This lines up with the fetch response-body/backpressure rework that landed in the 1.4 cycle (#36087, #35843, #36570). Please trybun upgrade --canary(or wait for Bun v1.4.0, which Claude Code will pick up automatically) and reopen if you still see multi-GiB allocations for a download of this size.This comment was written by Claude on behalf of the Bun team.