Express

Loading entire uploaded files into memory causes OOM

critical
Resource ContentionUpdated Feb 8, 2026(via Exa)
Technologies:
How to detect:

Using Buffer.concat to accumulate entire uploaded file in memory before writing causes out-of-memory errors for large uploads (multi-GB files).

Recommended action:

Use streams and pipe directly to disk with req.pipe(output). Streams maintain constant ~64KB memory buffer regardless of file size. 2GB upload uses same memory as 2KB upload.