Description
I'm running into frequent memory issues (OOM) during nuxt build across multiple projects.
Increasing --max-old-space-size usually resolves it, but it raises a more fundamental question: what is the expected memory footprint for a Nuxt build?
At the moment, it’s unclear what is “normal” vs. a sign of a misconfiguration or underlying issue.
Observations
- Fresh Nuxt project (minimal setup, only
@nuxt/ui)
- Peak memory usage: ~3.5–4 GB
- Larger project:
- Server + client source maps enabled
- Prerendering thousands of routes
- Peak memory usage: 12+ GB
- Runtime memory usage (after build) is relatively low in comparison
- On typical infrastructure (e.g. 8 GB RAM servers), builds can fail due to OOM
What I’ve found so far
There are multiple issues and discussions related to high memory usage, often tied to:
- Vite / Rollup internals
- Source maps
- Large prerender workloads
However, I haven't found clear guidance on:
- Expected baseline memory usage
- How memory scales with project size/features
- Recommended limits or infrastructure planning
Questions
- What is considered a normal / expected memory range for
nuxt build?
- Are there known major contributors to memory usage (e.g. sourcemaps, prerendering, modules)?
- Are there recommended strategies to reduce memory usage besides increasing Node memory?
- Is there any official guidance on sizing infrastructure for builds?
Description
I'm running into frequent memory issues (OOM) during
nuxt buildacross multiple projects.Increasing
--max-old-space-sizeusually resolves it, but it raises a more fundamental question: what is the expected memory footprint for a Nuxt build?At the moment, it’s unclear what is “normal” vs. a sign of a misconfiguration or underlying issue.
Observations
@nuxt/ui)What I’ve found so far
There are multiple issues and discussions related to high memory usage, often tied to:
However, I haven't found clear guidance on:
Questions
nuxt build?