istanbuljs / nyc

the Istanbul command line interface

Home Page:https://istanbul.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

haddasbronfman opened this issue · comments

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

  • [ V] still occurring when I run NODE_OPTIONS=--max-old-space-size=4096 nyc ts-mocha... instead of nyc ts-mocha...

We also faced this issue

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