istanbuljs / nyc

the Istanbul command line interface
https://istanbul.js.org/
ISC License
5.54k stars 353 forks source link

Error "JavaScript heap out of memory" in v15.1.0 #1525

Open haddasbronfman opened 11 months ago

haddasbronfman commented 11 months ago

Link to bug demonstration repository

https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main

steps to reproduce:

  1. clone the above project (opentelemetry-js-contrib)
  2. run: npm install --ignore-scripts
  3. run: npx lerna bootstrap --no-ci --hoist --nohoist=‘zone.js’ --nohoist=‘mocha’ --nohoist=‘ts-mocha’
  4. run: cd plugins/node/opentelemetry-instrumentation-mongodb/
  5. run: export RUN_MONGODB_TESTS=1
  6. from another terminal, run cd plugins/node/opentelemetry-instrumentation-mongodb/examples and run: npm run docker:start. this will start mongodb docker.
  7. run: npm run test

Expected Behavior

tests should run

Observed Behavior

tests doesn't run image

Troubleshooting steps

cqcmdwym commented 9 months ago

We also faced this issue

RobertInAms commented 7 months ago

We have discovered the following : For one of our projects, after an upgrade cycle, nyc suddenly started using 8GB which would crash our build pipeline. Investigation showed we had some unnecessary peerDependencies. We removed them and now nyc is running fast and efficient.

We think there must have been some circular dependency