Skip to content

Memory usage during nuxt build #34849

@remihuigen

Description

@remihuigen

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

  1. What is considered a normal / expected memory range for nuxt build?
  2. Are there known major contributors to memory usage (e.g. sourcemaps, prerendering, modules)?
  3. Are there recommended strategies to reduce memory usage besides increasing Node memory?
  4. Is there any official guidance on sizing infrastructure for builds?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions