.forge/issues/631e14a9-8678-4817-a87b-c6c0d4e76bbd/issue.md 1.2 KiB 39 lines Raw

id: 631e14a9-8678-4817-a87b-c6c0d4e76bbd title: 'serve: static GET/HEAD buffers whole file in RAM (OOM on large raw files)' state: closed labels:


What

Static file responses buffer the whole file into memory before sending, for GET and HEAD:

Raw blobs are unbounded (build streams any size to raw/), so /raw/big.bin allocates the full size per request. With MAX_CONNS=64, a handful of large files can OOM the process.

Reproduced

64 MB blob, VmHWM before/after one request:

VmHWM:  70,540 kB

(process baseline ~5 MB). HEAD performs the same read.

Impact

Remote OOM/DoS on hu13 serve; the streaming path already exists for git packs (respond_file) but is not used for static assets.

Fix

view raw