Skip to content

Too much memory usage on build #58902

@alexstine

Description

@alexstine

Description

I spun up my new WSL VM this afternoon and discovered the npm run build script is using an insane amount of memory. I received a Node out of memory heap error and had to increase using this environment variable.

export NODE_OPTIONS=--max_old_space_size=6000

It looks like at peak build, it nearly uses 3GB of memory which is absolutely insane. It fails right at the TypeScript build.

Step-by-step reproduction instructions

  1. Spin up a WSL2 Ubuntu 20.04 VM.
  2. Clone the repo.
  3. Run npm i && npm run build.
  4. See error.

Screenshots, screen recording, code snippet

No response

Environment info

N/A.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended[Type] Build ToolingIssues or PRs related to build tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions