Skip to content

JavaScript heap out of memory #1286

@Dreamsorcerer

Description

@Dreamsorcerer

My project was working fine 13 months ago (2024-04-24), but at some point the tests started failing. I've been trying to figure out what is wrong, but when I call user.type(), the test hangs for several minutes until it runs out of memory, like it's stuck in an infinite loop.

I've tried a multitude of different versions, upgrading and downgrading the various testing-library dependencies, but it continues to fail every single time.

<--- Last few GCs --->
[3104:0x22afb200]   195238 ms: Mark-Compact 4039.3 (4129.7) -> 4023.8 (4130.2) MB, 3306.25 / 0.00 ms  (average mu = 0.132, current mu = 0.023) allocation failure; scavenge might not succeed
[3104:0x22afb200]   197835 ms: Mark-Compact 4039.7 (4130.2) -> 4024.3 (4130.7) MB, 2561.44 / 0.00 ms  (average mu = 0.079, current mu = 0.014) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
 1: 0xb8cf03 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/usr/local/bin/node]
 2: 0xf04140 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/local/bin/node]
 3: 0xf04427 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/local/bin/node]
 4: 0x1116075  [/usr/local/bin/node]
 5: 0x1116604 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
 6: 0x112d4f4 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [/usr/local/bin/node]
 7: 0x112dd0c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
 8: 0x1104011 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
 9: 0x11051a5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0x10e27f6 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
11: 0x153e336 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
12: 0x7fba06e99ef6 
Aborted (core dumped)
error Command failed with exit code 134.

The package.json from my current attempt looks like:
https://github.com/aio-libs/aiohttp-admin/blob/9e03deb885ebf7a097aea41113891df195ea93e7/admin-js/package.json

And the test run:
https://github.com/aio-libs/aiohttp-admin/actions/runs/15261816820/job/42920980207?pr=933

The actual test it's running is:
https://github.com/aio-libs/aiohttp-admin/blob/9e03deb885ebf7a097aea41113891df195ea93e7/admin-js/tests/simple.test.js#L66-L73

If I remove the user.type() line, then there's no error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds assessmentThis needs to be looked at by a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions