Skip to content

JavaScript heap out of memory #1286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Dreamsorcerer opened this issue May 26, 2025 · 4 comments
Open

JavaScript heap out of memory #1286

Dreamsorcerer opened this issue May 26, 2025 · 4 comments
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member

Comments

@Dreamsorcerer
Copy link

Dreamsorcerer commented May 26, 2025

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.

@Dreamsorcerer Dreamsorcerer added bug Something isn't working needs assessment This needs to be looked at by a team member labels May 26, 2025
@Dreamsorcerer
Copy link
Author

Wait, I have other tests working that called user.type()...
Maybe there's something wrong with the element it's trying to type into, but still seems like a bug that it just churns until running out of memory.

@Dreamsorcerer
Copy link
Author

If I log the element's outerHTML, it's:

<input aria-invalid="false" id="data.id" name="data.id" type="number" step="any" class="MuiInputBase-input MuiFilledInput-input MuiInputBase-inputSizeSmall css-1zuho2-MuiInputBase-input-MuiFilledInput-input" value="">

@Dreamsorcerer
Copy link
Author

I've got the same issue in another test with userEvent.click(). Error happens an this line:
https://github.com/aio-libs/aiohttp-admin/blob/19345f799174bdc1d35b57a4d265e17c8a2cd383/admin-js/tests/simple.test.js#L94

outerHTML of this one is:

<li class="MuiButtonBase-root MuiMenuItem-root MuiMenuItem-gutters MuiMenuItem-root MuiMenuItem-gutters css-kk1bwy-MuiButtonBase-root-MuiMenuItem-root" tabindex="-1" role="option" aria-selected="false" data-value="2">GBP<span class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"></span></li>

@Dreamsorcerer
Copy link
Author

It managed to click several things before that though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member
Projects
None yet
Development

No branches or pull requests

1 participant