testcafe: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Steps to reproduce: Clone this repo - https://github.com/testcafeuser/TestcafeIssue.git execute the command from terminal testcafe chrome test1.js --hostname localhost --video artifacts/videos/

I see the below error:

mbp-010210:testcafeIssue` myusername$ testcafe chrome test1.js --hostname localhost --video artifacts/videos/
Using locally installed version of TestCafe.
 Running tests in:
 - Chrome 86.0.4240.111 / macOS 10.15.7

 Getting Started
^C^C^C^C^C^C


^C
<--- Last few GCs --->

[26589:0x102811000]   117971 ms: Mark-sweep 1272.4 (1440.4) -> 1256.9 (1436.9) MB, 5096.6 / 81.1 ms  (average mu = 0.072, current mu = 0.041) allocation failure scavenge might not succeed
[26589:0x102811000]   118056 ms: Scavenge 1270.9 (1436.9) -> 1261.9 (1439.4) MB, 9.1 / 0.3 ms  (average mu = 0.072, current mu = 0.041) allocation failure 
[26589:0x102811000]   118126 ms: Scavenge 1272.5 (1439.4) -> 1265.6 (1440.4) MB, 10.6 / 0.4 ms  (average mu = 0.072, current mu = 0.041) allocation failure 


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x1640471dbe3d]
Security context: 0x18af5729e6e9 <JSObject>
    1: /* anonymous */(aka /* anonymous */) [0x18af83d50369](this=0x18afab8026f1 <undefined>,0x18af83d4ffc1 <Error map = 0x18af4c4750b9>)
    2: StubFrame [pc: 0x1640471c1811]
    3: StubFrame [pc: 0x16404719f83a]
    4: EntryFrame [pc: 0x164047184ba1]
    5: ExitFrame [pc: 0x1640471dbe3d]
    6: _tickCallback [0x18af36305039] [internal/process/next_tick.js:...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x10003d051 node::Abort() [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
 2: 0x10003d25b node::OnFatalError(char const*, char const*) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
 3: 0x1001b90e5 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
 4: 0x100587042 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
 5: 0x100589b15 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
 6: 0x1005859bf v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
 7: 0x100583b94 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
 8: 0x10059042c v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
 9: 0x1005904af v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
10: 0x100575f1c v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::CopyArrayAndGrow<v8::internal::FixedArray>(v8::internal::Handle<v8::internal::FixedArray>, int, v8::internal::PretenureFlag) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
11: 0x100652211 v8::internal::Isolate::EnqueueMicrotask(v8::internal::Handle<v8::internal::Microtask>) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
12: 0x1006c07ff v8::internal::JSPromise::TriggerPromiseReactions(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::PromiseReaction::Type) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
13: 0x10081814e v8::internal::Runtime_RejectPromise(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/myusername/.nvm/versions/node/v10.19.0/bin/node]
14: 0x1640471dbe3d 
15: 0x164047418060 
Abort trap: 6

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Hi @miherlosev,

This issue is happening for me locally for the automation tests which involve switching between multiple windows etc., Initially , I thought this was some bug related to video recording but later I disabled recording videos and can still this issue happening.

This issue is with Testcafe API https://testcafe.io/402900/resources/blog/2020-8-26-introducing-multi-window-tests-beta

Can you please look into this further and provide a solution ??

Thanks Deepti