Nextjs Build OOM issue.
Answered
Gharial posted this in #help-forum
GharialOP
Hi there
Anyone knows how to resolve nextjs OOM issue when building the app.
https://nextjs.org/docs/app/building-your-application/optimizing/memory-usage
https://vercel.com/guides/troubleshooting-sigkill-out-of-memory-errors
The 2 docs is not working for me
Nextjs version: 14.1.3
Anyone knows how to resolve nextjs OOM issue when building the app.
https://nextjs.org/docs/app/building-your-application/optimizing/memory-usage
https://vercel.com/guides/troubleshooting-sigkill-out-of-memory-errors
The 2 docs is not working for me
Nextjs version: 14.1.3
Answered by Transvaal lion
Incremental static regeneration: https://nextjs.org/docs/pages/building-your-application/data-fetching/incremental-static-regeneration
4 Replies
Transvaal lion
We had this issue specifically when trying to statically generate large sites (100k+ pages). Our solution was to audit the most accessed pages and statically generate those and to enable incremental static regeneration for the rest so the first build of any specific static page was done at run-time, not build time.
GharialOP
Hi, Good idea, how to do it
And any suggestions about how to find the root cause?
Transvaal lion
Incremental static regeneration: https://nextjs.org/docs/pages/building-your-application/data-fetching/incremental-static-regeneration
Answer