Skip to content

Bun 1.3.11 (integrated in Claude Code) on Windows x64 OOM crash #28174

Closed

Description

@lilavaz4444

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

https://bun.report/1.3.11/e_1a2743b6GuhogCoy/sf0y5wMmvw9U8839Uotqx1B8ll11Biw2n4Bqixj4B68uj4Bu754W4glvRCYKERNEL32.DLLut0LCSntdll.dll40hPA9

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

  1. github-actions commented on Mar 17, 2026

    @github-actions
    Contributor

    Found 3 possible duplicate issues:

    1. Bun 1.3.11 Windows OOM crash in AsyncHTTP #27842
    2. bun crashed after asking it to follow instructions in a .md file and convert c# code to python #25188
    3. Segfault (null pointer at 0x0) in long-running standalone executable on Windows after sustained memory pressure #26862

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. lilavaz4444 commented on Mar 17, 2026

    @lilavaz4444
    Author

    The issue is closely related to #27842, which got incorrectly marked as a duplicate of #22514.

  3. Jarred-Sumner commented on Aug 1, 2026

    @Jarred-Sumner
    Collaborator

    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 (as arrayBuffer(), via Bun.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 try bun 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions