Skip to content
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

Node 23: "heap out of memory" error when preferLocal option is enabled #1161

Closed
cedx opened this issue Oct 17, 2024 · 4 comments
Closed

Node 23: "heap out of memory" error when preferLocal option is enabled #1161

cedx opened this issue Oct 17, 2024 · 4 comments

Comments

@cedx
Copy link

cedx commented Oct 17, 2024

A simple script like this one causes a memory overflow when the preferLocal option is enabled:

import {execa} from "execa";
const $ = execa({preferLocal: true, stdio: "inherit"});
await $`node --version`;

// Error... but OK when `preferLocal` is `false`.

The resulting output is as follows:

<--- Last few GCs --->

[16584:000001E95B1B6000]    39610 ms: Scavenge (interleaved) 2041.5 (2046.8) -> 2038.9 (2047.3) MB, pooled: 0 MB, 4.57 / 0.00 ms  (average mu = 0.173, current mu = 0.139) allocation failure;
[16584:000001E95B1B6000]    41666 ms: Mark-Compact (reduce) 2039.1 (2047.3) -> 2038.9 (2041.1) MB, pooled: 0 MB, 1652.12 / 0.00 ms  (+ 1.6 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 1657 ms) (average mu = 0.

<--- JS stacktrace --->

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

 1: 00007FF7809025DB node::SetCppgcReference+15707
 2: 00007FF78086B7F8 DSA_meth_get_flags+98136
 3: 00007FF78156CF71 v8::Isolate::ReportExternalAllocationLimitReached+65
 4: 00007FF7815597B6 v8::Function::Experimental_IsNopFunction+2710
 5: 00007FF781390680 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+34016
 6: 00007FF78138997D v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+6109
 7: 00007FF78138589D v8::Platform::SystemClockTimeMillis+655213
 8: 00007FF780BA0D1D BIO_ssl_shutdown+189
 9: 00007FF78138D214 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+20596
10: 00007FF7813F1F1A v8::Locker::IsLocked+7338
11: 00007FF78105CBD0 v8::internal::Version::GetString+451664
12: 00007FF7215F027A

execa v9.4.1
Node.js v23.0.0
Windows 10 (x64)

@cedx
Copy link
Author

cedx commented Oct 17, 2024

It seems that the problem lies solely with Node.js and not with this package (see nodejs/node#55418).

@cedx cedx closed this as completed Oct 17, 2024
@ehmicky
Copy link
Collaborator

ehmicky commented Oct 18, 2024

Thanks for reporting @cedx.

To anyone impacted: this seems to be a bug with Node.js 23.0.0, which is currently being fixed. Workaround is to keep using Node 22 until the fix is released.

@cedx
Copy link
Author

cedx commented Oct 25, 2024

Issue fixed in Node.js v23.1.0.

@ehmicky
Copy link
Collaborator

ehmicky commented Oct 26, 2024

Great! Thanks for the notification @cedx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants