Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid crash when "--max-old-space-size" is present #5017

Merged
merged 1 commit into from
Aug 13, 2020

Conversation

evanw
Copy link
Contributor

@evanw evanw commented Aug 13, 2020

↪️ Pull Request

This is a fix for issue #4795. Parcel 2 runs out of memory building large code bases. Normally you can pass the --max-old-space-size=... flag to node to increase the memory ceiling for node programs, but this doesn't work with Parcel because passing this flag causes Parcel to crash.

💻 Examples

The crash looks like this:

$ npm install parcel
$ touch empty.js
$ node --max-old-space-size=8192 node_modules/.bin/parcel empty.js
Error [ERR_WORKER_INVALID_EXEC_ARGV] Initiated Worker with invalid execArgv flags: --max-old-space-size=8192
    at new Worker (internal/worker.js:134:13)
    ...

This change prevents the crash.

🚨 Test instructions

I ran this command inside the Parcel repo to test this change:

yarn build && NODE_ENV=test node --max-old-space-size=8192 node_modules/.bin/mocha

This command fails without my change and passes with my change.

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@height
Copy link

height bot commented Aug 13, 2020

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants