You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All reports are read into memory before any merging occurs which, on some machines, causes a FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - Javascript heap out of memory error.
The project I am working on has many integration tests (1500+) that use instrumented versions of multiple JS builds, each of which write a new coverage report. Each file is between 2.5mb - 4mb.
Temporary Workaround
If anyone else stumbles upon this and needs a temporary workaround, I wrote a quick basic script to merge the results to a single file which you can then use when calling nyc report ... https://gist.github.com/RyanV/6fe44b80082a8eb609199bfb0e8da953
Or if you have the memory to spare, increase the heap size allocation by passing the flag node --max-old-space-size=[size] nyc ..., where [size] is a number value in megabytes.
Forensic Information
OS: Mac, Windows
Node Version: 7.9.0
NPM Version: 4.2.0
The text was updated successfully, but these errors were encountered:
Expected Behavior
when a directory has multiple report files, running
nyc report ...
should read, parse, and merge each report file one by one.See original istanbul behavior:
https://github.com/gotwarlost/istanbul/blob/master/lib/command/report.js#L109
https://github.com/gotwarlost/istanbul/blob/master/lib/collector.js#L71
Observed Behavior
All reports are read into memory before any merging occurs which, on some machines, causes a
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - Javascript heap out of memory
error.See:
https://github.com/istanbuljs/nyc/blob/master/index.js#L428
https://github.com/istanbuljs/nyc/blob/master/index.js#L517
Background
The project I am working on has many integration tests (1500+) that use instrumented versions of multiple JS builds, each of which write a new coverage report. Each file is between 2.5mb - 4mb.
Temporary Workaround
If anyone else stumbles upon this and needs a temporary workaround, I wrote a quick basic script to merge the results to a single file which you can then use when calling
nyc report ...
https://gist.github.com/RyanV/6fe44b80082a8eb609199bfb0e8da953
Or if you have the memory to spare, increase the heap size allocation by passing the flag
node --max-old-space-size=[size] nyc ...
, where[size]
is a number value in megabytes.Forensic Information
OS: Mac, Windows
Node Version: 7.9.0
NPM Version: 4.2.0
The text was updated successfully, but these errors were encountered: