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

NCC consumes too much memory, can't be used with github pipelines #784

Open
Yehonal opened this issue Sep 28, 2021 · 3 comments
Open

NCC consumes too much memory, can't be used with github pipelines #784

Yehonal opened this issue Sep 28, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@Yehonal
Copy link

Yehonal commented Sep 28, 2021

I'm using this command: ncc -m -s src/index.js to compile a large project in a single javascript bundle. However, it doesn't work in github pipelines since their containers are limited to 2 GB of ram causing a "memory heap" error during compilation.

I've tested locally by using this command: /usr/bin/time --format "%M" ncc -m -s src/index.js

And this is the result:

34630kB  env/dist/apps/manage-panel/bundle/index.js
90543kB  [146603ms] - ncc 0.31.1
4710052

4710052 -> It means that ncc consumes 4.7GB of ram to compile.

To reduce this amount I have to:

  1. disable the cache (-500Mb)
  2. disable the minification
  3. disable the sourcemap

doing so, the memory consumed is 1.5GB (which is fine for github

By the way, despite cache that should be disabled in pipelines, minification and sourcemap together are consume way too much.
Is there a way to improve this?

@styfle styfle added enhancement New feature or request and removed enhancement New feature or request labels Sep 28, 2021
@styfle
Copy link
Member

styfle commented Sep 28, 2021

This sounds like a duplicate of #596

@Yehonal
Copy link
Author

Yehonal commented Sep 28, 2021

Kind of, source map is the less problematic (it also adds ~500MB) but the minification adds ~3.5 GB

@styfle styfle added the enhancement New feature or request label Sep 28, 2021
@styfle
Copy link
Member

styfle commented Sep 28, 2021

The minification currently uses terser, but we can look into using swc instead (experimental branch in #777)

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

No branches or pull requests

2 participants