Whole table / large file in memory
Part of the Scalability antipatterns check · fix arrives as a guide
What it is
A whole table, file, or upload is read into memory at once — a full SELECT into an array, or readFile on something arbitrarily large.
Why it matters
Peak memory scales with the data, not with the workload, so a large input takes the process down and every concurrent request with it. On serverless it hits the memory ceiling and the invocation is killed outright.
How to fix it
Stream it — a cursor over query results, a read stream for files — and process in chunks with bounded memory. Where the whole set genuinely is needed, cap the input size and reject anything above it explicitly.
Run them all on your app
Connect your repo and your live services with read-only scopes. The first scan is free, and nothing changes without your approval.