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

Out of memory errors as of v20y #47719

Closed
btakita opened this issue Apr 25, 2023 · 7 comments
Closed

Out of memory errors as of v20y #47719

btakita opened this issue Apr 25, 2023 · 7 comments

Comments

@btakita
Copy link

btakita commented Apr 25, 2023

Version

v20.0.0

Platform

Linux pathos 6.2.12-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Thu, 20 Apr 2023 16:11:27 +0000 x86_64 GNU/Linux

Subsystem

memory (stream/web?)

What steps will reproduce the bug?

I have an import/export process reading a ~250mb file which is now running out of memory when using a Web stream.

The memory is stable on v19.9.0 but grows until an Fatal javascript OOM in MemoryChunk allocation failed during deserialization. or a FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory occurs. It seems like while the stream is running, the memory usage increases. Backpressure does not help as this seems a symptom of memory growth over clock time while the stream is running. If the_ stream is prematurely stopped, the memory issue stops.

Not sure what information is needed for diagnostics. What is strange is that the Heap snapshot does not show memory growing during the stream, but the memory growth is observable while running top.

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

Every time.

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

The memory should remain stable with streams using backpressure.

What do you see instead?

The process memory usage grows until an out of memory error occurs.

Additional information

No response

@Trott
Copy link
Member

Trott commented Apr 26, 2023

@nodejs/whatwg-stream

@debadree25
Copy link
Member

debadree25 commented Apr 26, 2023

could be similar to #47128 and #46347 ? is there any example script to reproduce this?

@mcollina
Copy link
Member

We would need a reproduction to track this down.

@aduh95
Copy link
Contributor

aduh95 commented May 3, 2023

Has this been fixed in 20.1.0?

@btakita
Copy link
Author

btakita commented May 4, 2023

Has this been fixed in 20.1.0?

As of 20.10, the memory is stable.

This issue is probably fixed as well.

@btakita btakita closed this as completed May 4, 2023
@last-Programmer
Copy link

we have a typescript project and running eslint on the project gives out of memory error in 20.10 where as in 20.9 it works fine.

@rusakovic
Copy link

The issue is the same for 20.17 version in Bitrise step.

<--- Last few GCs --->
[6650:0x140008000]    27186 ms: Mark-Compact (reduce) 2033.8 (2084.5) -> 2033.4 (2084.9) MB, 349.12 / 0.04 ms  (+ 25.5 ms in 5 steps since start of marking, biggest step 8.0 ms, walltime since start of marking 384 ms) (average mu = 0.322, current mu = 0.2[6650:0x140008000]    28117 ms: Mark-Compact (reduce) 2034.1 (2085.4) -> 2034.1 (2085.7) MB, 817.29 / 0.00 ms  (average mu = 0.197, current mu = 0.122) allocation failure; GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
 1: 0x1048e75a4 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
 2: 0x104a7004c v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
 3: 0x104c44720 v8::internal::Heap::GarbageCollectionReasonToString(v8::internal::GarbageCollectionReason) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
 4: 0x104c431fc v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
 5: 0x104c39a14 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
 6: 0x104c3a274 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
 7: 0x104c1f2e4 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
 8: 0x1050070e8 v8::internal::Runtime_AllocateInOldGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
 9: 0x105364c44 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
10: 0x10a76f03c 
11: 0x10aa18778 
12: 0x10531726c Builtins_LoadIC [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
13: 0x10a6d2830 
14: 0x1052d9708 construct_stub_create_deopt_addr [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
15: 0x10a7e1d38 
16: 0x10538bfb4 Builtins_ArrayReduce [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
17: 0x10a4db09c 
18: 0x10aaca004 
19: 0x105313210 Builtins_AsyncFunctionAwaitResolveClosure [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
20: 0x1053c0fb8 Builtins_PromiseFulfillReactionJob [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
21: 0x105302b94 Builtins_RunMicrotasks [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
22: 0x1052da3f4 Builtins_JSRunMicrotasksEntry [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
23: 0x104bb1ba0 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
24: 0x104bb208c v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
25: 0x104bb2268 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
26: 0x104bd9434 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
27: 0x104bd9bd0 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
28: 0x104810c4c node::InternalCallbackScope::Close() [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
29: 0x104810fe4 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
30: 0x104827068 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
31: 0x1048ecd80 node::fs::FSReqCallback::Resolve(v8::Local<v8::Value>) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
32: 0x1048ed490 node::fs::AfterNoArgs(uv_fs_s*) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
33: 0x1048e1430 node::MakeLibuvRequestCallback<uv_fs_s, void (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
34: 0x1052b7b00 uv__work_done [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
35: 0x1052bb550 uv__async_io [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
36: 0x1052cd628 uv__io_poll [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
37: 0x1052bbb14 uv_run [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
38: 0x1048116f0 node::SpinEventLoopInternal(node::Environment*) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
39: 0x1049273f0 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
40: 0x104927104 node::NodeMainInstance::Run() [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
41: 0x1048aefa0 node::Start(int, char**) [/Users/vagrant/.nvm/versions/node/v20.17.0/bin/node]
42: 0x192c77f28 start [/usr/lib/dyld]

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

No branches or pull requests

7 participants