CodeZettaInterview Hub

Node.js · Streams · Senior · Debugging

Debugging: memory grows while streaming a large file upload. Likely causes?

Short Interview Answer

Buffering entire body, missing backpressure, collecting chunks into an array, or not consuming the stream.

Detailed Explanation

Ensure upstream pauses correctly. Avoid `await req.arrayBuffer()` for huge bodies. Stream to disk/object storage. Watch for multiple consumers.

Did you know this answer?