nyc: JavaScript heap out of memory in v15.0.0.
In v15.0.0, JS runs out of memory on a relatively small project while running nyc in a docker container. In v14.1.1 it all worked fine.
Link to bug demonstration repository
This is a sensitive project and with private source control
Expected Behavior
Coverage shows
Observed Behavior
Javascript has a heap overflow
test-frontend |
test-frontend | [] 100% (completed)
test-frontend |
test-frontend | WEBPACK Compiled successfully in 32137ms
test-frontend |
test-frontend | MOCHA Testing...
test-frontend |
test-frontend |
test-frontend | <--- Last few GCs --->
test-frontend |
test-frontend | [50:0x3172330] 138018 ms: Mark-sweep 1473.6 (1500.4) -> 1469.9 (1500.4) MB, 1653.7 / 0.1 ms (average mu = 0.133, current mu = 0.003) allocation failure scavenge might not succeed
test-frontend | [50:0x3172330] 140149 ms: Mark-sweep 1474.3 (1500.9) -> 1470.5 (1500.9) MB, 1958.3 / 0.0 ms (average mu = 0.107, current mu = 0.081) allocation failure scavenge might not succeed
test-frontend |
test-frontend |
test-frontend | <--- JS stacktrace --->
test-frontend |
test-frontend | ==== JS stack trace =========================================
test-frontend |
test-frontend | 0: ExitFrame [pc: 0x1374fd9]
test-frontend | Security context: 0x2a0f1cf008a1 <JSObject>
test-frontend | 1: SourceMapConsumer_allGeneratedPositionsFor [0x39a4144ed0d9] [/usr/src/app/node_modules/source-map/lib/source-map-consumer.js:~178] [pc=0x35a2ce60f67b](this=0x03f2718c0111 <BasicSourceMapConsumer map =
0x149ab65e7761>,0x2352fe700259 <Object map = 0x2d594ef7fbd1>)
test-frontend | 2: /* anonymous */(aka /* anonymous */) [0x24b0c0b9a129] [/usr/src/app/node_modules/@babel/...
test-frontend |
test-frontend | FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
test-frontend |
test-frontend | Writing Node.js report to file: report.20200102.194151.50.0.001.json
test-frontend | Node.js report completed
test-frontend | 1: 0x9da7c0 node::Abort() [node]
test-frontend | 2: 0x9db976 node::OnFatalError(char const*, char const*) [node]
test-frontend | 3: 0xb39f1e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
test-frontend | 4: 0xb3a299 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
test-frontend | 5: 0xce5635 [node]
test-frontend | 6: 0xce5cc6 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
test-frontend | 7: 0xcf1b5a v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
test-frontend | 8: 0xcf2a65 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
test-frontend | 9: 0xcf5478 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
test-frontend | 10: 0xcbbda7 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType) [node]
test-frontend | 11: 0xff1e0b v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
test-frontend | 12: 0x1374fd9 [node]
test-frontend | ERROR mochapack exited with code null.
test-frontend | ----------|---------|----------|---------|---------|-------------------
test-frontend | File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
test-frontend | ----------|---------|----------|---------|---------|-------------------
test-frontend | All files | 0 | 0 | 0 | 0 |
test-frontend | ----------|---------|----------|---------|---------|-------------------
test-frontend | npm ERR! code ELIFECYCLE
test-frontend | npm ERR! errno 1
test-frontend | npm ERR! frontend@0.1.0 test:unit:coverage: `nyc vue-cli-service test:unit`
test-frontend | npm ERR! Exit status 1
test-frontend | npm ERR!
test-frontend | npm ERR! Failed at the frontend@0.1.0 test:unit:coverage script.
test-frontend | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
test-frontend |
test-frontend | npm ERR! A complete log of this run can be found in:
test-frontend | npm ERR! /root/.npm/_logs/2020-01-02T19_41_51_661Z-debug.log
test-frontend | test-frontend exited with code 1
Aborting on container exit...
make: *** [test-unit] Error 1
Troubleshooting steps
Environment Information
Using wepback + Vue.js
# paste the output here
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 31 (14 by maintainers)
Commits related to this issue
- fix: Merge reports with concurrency limit instead of fetching everything in memory (#1263) — committed to canonic-epicure/nyc by canonic-epicure 4 years ago
- fix: Data merge concurrency limit to prevent OOM (#1293) Fixes #1263 — committed to istanbuljs/nyc by canonic-epicure 4 years ago
- [QA][Code Coverage] follow up pr for ftr auto config handling & fix merge (#131734) * [QA][Code Coverage] fixup for auto config handling pr ## Summary Embed buildkite pipeline definition. Fo... — committed to elastic/kibana by wayneseymour 2 years ago
- ci(github): increase memory available to C8 It seems like C8 is suffering from the same memory issue NYC used to suffer from Related tickets: bcoe/c8#338 istanbuljs/nyc#1263 — committed to serenity-js/serenity-js by jan-molak a year ago
- ci(github): increase memory available to C8 It seems like C8 is suffering from the same memory issue NYC used to suffer from Related tickets: bcoe/c8#338 istanbuljs/nyc#1263 — committed to serenity-js/serenity-js by jan-molak a year ago
- Do not run nyc on `npm test` task. Since, nyc 15.0+ is unstable... https://github.com/istanbuljs/nyc/issues/1263 — committed to tokuhirom/line-bot-sdk-nodejs by tokuhirom 8 months ago
- Do not run nyc on `npm test` task. (#570) Since, nyc 15.0+ is unstable... https://github.com/istanbuljs/nyc/issues/1263 — committed to line/line-bot-sdk-nodejs by tokuhirom 8 months ago
I have 15.1.0 still I am getting the error WEBPACK Compiled successfully in 10351ms
MOCHA Testing…
<— Last few GCs —>
[97116:0x110008000] 82254 ms: Mark-sweep 2023.2 (2079.4) -> 2012.6 (2082.4) MB, 3773.9 / 0.0 ms (average mu = 0.082, current mu = 0.040) allocation failure scavenge might not succeed [97116:0x110008000] 84763 ms: Mark-sweep 2017.0 (2082.4) -> 2013.4 (2084.7) MB, 2494.7 / 0.0 ms (average mu = 0.052, current mu = 0.006) allocation failure GC in old space requested
<— JS stacktrace —>
==== JS stack trace =========================================
Security context: 0x3a5b2fb408a1 <JSObject> 2: set [0x3a5b2fb4e3d1](this=0x3a5b6c083e21 <JSWeakMap>,0x3a5baef3da61 <Object map = 0x3a5c00069f11>,0x3a5baef3eb49 <JSArray[0]>) 3: node [0x3a5b9dc78f31] [/Users/xx/code/connect/node_modules/@babel/traverse/lib/index.js:~75] [pc=0xc9bff3e7303](this=0x3a5bd8390ad1 <JSFunction traverse (sfi = 0x3a5bdbc76b11)>,0x3a5b…
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 0x10007f231 node::Abort() [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 2: 0x10007f3b5 node::OnFatalError(char const*, char const*) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 3: 0x100176887 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 4: 0x100176823 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 5: 0x1002fa9d5 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 6: 0x1002fc0a4 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 7: 0x1002f8f77 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 8: 0x1002f6f5d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 9: 0x1003026a0 v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 10: 0x1003026ef v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 11: 0x1002ce0c9 v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::RootIndex, int, v8::internal::Object, v8::internal::AllocationType) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 12: 0x1004db1ea v8::internal::HashTable<v8::internal::EphemeronHashTable, v8::internal::EphemeronHashTableShape>::EnsureCapacity(v8::internal::Isolate*, v8::internal::Handlev8::internal::EphemeronHashTable, int, v8::internal::AllocationType) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 13: 0x1004dbe16 v8::internal::ObjectHashTableBase<v8::internal::EphemeronHashTable, v8::internal::EphemeronHashTableShape>::Put(v8::internal::Isolate*, v8::internal::Handlev8::internal::EphemeronHashTable, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 14: 0x1004fedcd v8::internal::JSWeakCollection::Set(v8::internal::Handlev8::internal::JSWeakCollection, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 15: 0x1005e054d v8::internal::Runtime_WeakCollectionSet(int, unsigned long*, v8::internal::Isolate*) [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] 16: 0x1009311f9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/xx/.nvm/versions/node/v12.14.1/bin/node] error Command failed with signal “SIGABRT”. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
=============================== Coverage summary =============================== Statements : Unknown% ( 0/0 ) Branches : Unknown% ( 0/0 ) Functions : Unknown% ( 0/0 ) Lines : Unknown% ( 0/0 )
error Command failed with exit code 1.
I’m having the same issue on v15.1.0 with mocha
I’m still facing this on v15.1.0 while using AVA and Typescript
Delete your
coverage
output folder and try again.