Skip to content

Windows: knip OOMs (RangeError: Array buffer allocation failed) via oxc-parser raw transfer; no way to disable #1813

Description

@wainwright1000

Summary

On Windows, knip (v6+) crashes intermittently during parsing with:

RangeError: Array buffer allocation failed
    at createBuffer (.../oxc-parser/src-js/raw-transfer/common.js:294)
    ...
    at parseFile (.../knip/dist/typescript/ast-nodes.js)
    at WorkspaceWorker.runPlugins (.../knip/dist/WorkspaceWorker.js)

Root cause: knip enables oxc-parser's raw transfer on Node ≥ 22 (experimentalRawTransfer: rawTransferSupported() in dist/typescript/ast-nodes.js), and oxc-parser's raw-transfer path reserves a ~6 GiB ArrayBuffer per parse buffer. Windows has no overcommit, so that ~6 GiB is charged against the commit limit at allocation; under memory pressure the allocation throws. (Upstream oxc detail and minimal repro: oxc-project/oxc#23759, and the related allocator work in oxc #20513.)

Symptom shape

Intermittent and memory-pressure-dependent: knip run standalone usually passes; run as part of a fuller task chain, or alongside other processes (lower commit-free), it fails — sometimes deterministically. Linux is unaffected (overcommit). Seen on knip 6.17; the raw-transfer path is unchanged on the latest (6.19).

The gap

There is no knip config key, CLI flag, or env var to disable raw transfer — it is hardcoded to rawTransferSupported() — and oxc-parser exposes no env override either. So on a memory-constrained Windows machine there is no supported way to opt into the non-raw (normal-memory) parse path short of running knip on Node < 22 or patching ast-nodes.js.

Ask

An option / env var to disable raw transfer (fall back to the non-raw NAPI parse path), or an automatic fallback to the non-raw path on a RangeError: Array buffer allocation failed, until the underlying oxc allocation is bounded upstream.

Environment

Windows, Node v24.15.0, knip 6.17.1, oxc-parser 0.135.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions