Replies: 1 comment
|
First thing to settle is which process is dying, because The parent compiles. The static-generation workers render your pages. A parent that peaks during compilation and a worker that climbs page after page look identical from the outside (your instance OOMs) and have nothing to do with each other. Sample the whole process tree over the build, not just the total, and you'll see which curve is yours. If it's the workers, the number that matters is MB per page. If it's the parent, it's a single peak during compilation, and no amount of reducing page count helps. Then the thing that will waste your time if nobody tells you: one build is not a measurement. I tried to A/B one option in a config like yours today, three runs per arm, alternating:
Run 1 says the option doubles peak memory. It doesn't. The spread inside a single arm is wider than the gap between arms, and there's a drift across runs that has nothing to do with the flag. Had I stopped at one run per arm I'd have posted a confident wrong answer. Alternate the arms, do at least three, and treat anything smaller than your within-arm spread as noise. For actually naming the packages, since that's what you asked: heap snapshots of the compilation process, not the workers. Run the build with One more thing worth checking on your version. In current Next, if (isolatedMemory) {
delete nodeOptions['max-old-space-size'];
delete nodeOptions['max_old_space_size'];
}So the one flag every OOM guide tells you to raise never reaches the worker that runs out of memory. I don't know when that started and I can't confirm it applied to your version, so grep your own I package the tree sampling as next-leak: It reports the parent peak and the worker curve separately, and MB per page. Node 22+. It doesn't need Are the workers climbing per page, or is it a single peak while it compiles? That decides everything else. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
My
next buildprocess uses more than 2GB ram and causes my cloud instance to OOM. I would like to profile it but I do not know the best way to do so to identify the packages that may be causing the issue.If there are any next config flags I should try that would also be very helpful. Currently I have
set, as well as setting
parallel: falseon theTerserPlugin, but it hasn't made a meaningful difference in the end behavior.Additional information
Example
No response
All reactions