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 #55418

Open
bricss opened this issue Oct 17, 2024 · 7 comments
Open

Node 23 - heap out of memory #55418

bricss opened this issue Oct 17, 2024 · 7 comments
Labels
path Issues and PRs related to the path subsystem. v23.x v23.x Issues that can be reproduced on v23.x or PRs targeting the v23.x-staging branch.

Comments

@bricss
Copy link

bricss commented Oct 17, 2024

Version

v23.0.0

Platform

Microsoft Windows NT 10.0.26100.0 x64

Subsystem

No response

What steps will reproduce the bug?

Source code cannot be provided

How often does it reproduce? Is there a required condition?

Reproduced all the time

What is the expected behavior? Why is that the expected behavior?

Application have to run

What do you see instead?

<--- Last few GCs --->

[25912:000001E1029B5000]   105733 ms: Mark-Compact 15953.4 (24147.2) -> 9964.4 (26350.7) MB, pooled: 0 MB, 28618.29 / 0.00 ms  (average mu = 0.437, current mu = 0.349) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 00007FF62F6E25DB node::SetCppgcReference+15707
 2: 00007FF62F64B7F8 DSA_meth_get_flags+98136
 3: 00007FF63034CF71 v8::Isolate::ReportExternalAllocationLimitReached+65
 4: 00007FF6303397B6 v8::Function::Experimental_IsNopFunction+2710
 5: 00007FF630170680 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+34016
 6: 00007FF63016D3DD v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+21053
 7: 00007FF630182C76 v8::Isolate::GetHeapProfiler+8150
 8: 00007FF630182DAE v8::Isolate::GetHeapProfiler+8462
 9: 00007FF630193CF7 v8::Isolate::GetHeapProfiler+77911
10: 00007FF62FE3BC8B v8::internal::Version::GetString+447755
11: 00007FF63040B824 v8::PropertyDescriptor::writable+738884
12: 00007FF63040BE96 v8::PropertyDescriptor::writable+740534
13: 00007FF5E812D91B

Process finished with exit code 134

Additional information

Using --max-old-space-size=8192 in NODE_OPTIONS didn't help 😣

@targos targos added the v23.x v23.x Issues that can be reproduced on v23.x or PRs targeting the v23.x-staging branch. label Oct 17, 2024
@cedx
Copy link

cedx commented Oct 17, 2024

Same issue here 😢 (also using Windows 10)

@mcollina
Copy link
Member

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

@cedx
Copy link

cedx commented Oct 17, 2024

For my part, I managed to locate the source of my error: it comes from the execa package when the preferLocal option is enabled.

import {execa} from "execa"; // Installed: v9.4.1
const $ = execa({preferLocal: true, stdio: "inherit"});
await $`node --version`;
// Error... but OK when `preferLocal` is `false`.

I guess I'll just have to open a ticket on the execa repository.
(Done => sindresorhus/execa#1161)

@bricss
Copy link
Author

bricss commented Oct 17, 2024

In my case I'm afraid it will be almost impossible to locate the source of the error. We have a massive back-end with plenty of packages and I even don't know where to start looking for the root cause. But I have an idea that issue might be related to that one bug: #55414

@RedYetiDev

This comment has been minimized.

@RedYetiDev RedYetiDev closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
@RedYetiDev RedYetiDev added invalid Issues and PRs that are invalid. and removed v23.x v23.x Issues that can be reproduced on v23.x or PRs targeting the v23.x-staging branch. labels Oct 17, 2024
@legendecas
Copy link
Member

legendecas commented Oct 17, 2024

This can be reproduced with @cedx's snippet on Windows.

The issue on this is path.resolve('D:\\', '..') returns D:, rather than D:\\ on Windows. This causes indefinite loop on https://github.com/sindresorhus/unicorn-magic/blob/main/node.js#L16-L29.

@legendecas legendecas reopened this Oct 17, 2024
@legendecas legendecas added v23.x v23.x Issues that can be reproduced on v23.x or PRs targeting the v23.x-staging branch. path Issues and PRs related to the path subsystem. and removed invalid Issues and PRs that are invalid. labels Oct 17, 2024
@RedYetiDev RedYetiDev added the windows Issues and PRs related to the Windows platform. label Oct 17, 2024
@RedYetiDev
Copy link
Member

RedYetiDev commented Oct 17, 2024

Ahh, it must be specific to windows (at least in this case), as I couldn't reproduce on Linux, my apologies for jumping to conclusions.

If that's the case, this is resolved by #55414, and may be a duplicate of #55410

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
path Issues and PRs related to the path subsystem. v23.x v23.x Issues that can be reproduced on v23.x or PRs targeting the v23.x-staging branch.
Projects
None yet
Development

No branches or pull requests

6 participants