deno
deno copied to clipboard
Next.js project weird Node.js process OOM crash
To reproduce:
mkdir repro && cd reprodeno run -A --unstable npm:degit 'timlrx/tailwind-nextjs-starter-blog'- Convert
next.config.jsto ESM npm ideno run -A --unstable-byonm ./node_modules/.bin/next dev
In the wall of errors, you'll find:
<--- Last few GCs --->
[5512:0x130008000] 34 ms: Mark-Compact 13.6 (14.3) -> 12.7 (15.1) MB, 1.67 / 0.00 ms (average mu = 0.951, current mu = 0.951) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x10065e660 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
2: 0x1007d8c84 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
3: 0x1007d8c34 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
4: 0x10097e410 v8::internal::Heap::CallGCPrologueCallbacks(v8::GCType, v8::GCCallbackFlags, v8::internal::GCTracer::Scope::ScopeId) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
5: 0x10097d318 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
6: 0x10097577c v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
7: 0x100975f20 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
8: 0x10095d988 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
9: 0x100954874 v8::internal::MaybeHandle<v8::internal::SeqTwoByteString> v8::internal::FactoryBase<v8::internal::Factory>::NewRawStringWithMap<v8::internal::SeqTwoByteString>(int, v8::internal::Tagged<v8::internal::Map>, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
10: 0x100bb62bc v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle<v8::internal::ConsString>, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
11: 0x100a75bc4 v8::internal::CompilationCacheTable::LookupScript(v8::internal::Handle<v8::internal::CompilationCacheTable>, v8::internal::Handle<v8::internal::String>, v8::internal::ScriptDetails const&, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
12: 0x10086fd38 v8::internal::CompilationCacheScript::Lookup(v8::internal::Handle<v8::internal::String>, v8::internal::ScriptDetails const&) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
13: 0x10087ad2c v8::internal::(anonymous namespace)::GetSharedFunctionInfoForScriptImpl(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, v8::internal::ScriptDetails const&, v8::Extension*, v8::internal::AlignedCachedData*, v8::internal::BackgroundDeserializeTask*, bool (*)(int, void*), void*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason, v8::internal::NativesFlag) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
14: 0x1007e0a90 v8::ScriptCompiler::CompileUnboundInternal(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
15: 0x100651248 node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
16: 0x10082f224 v8::internal::FunctionCallbackArguments::Call(v8::internal::Tagged<v8::internal::CallHandlerInfo>) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
17: 0x10082f050 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, unsigned long*, int) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
18: 0x10082ee44 v8::internal::Builtin_HandleApiConstruct(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
19: 0x10046f854 Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit [/opt/homebrew/Cellar/node/21.5.0/bin/node]
20: 0x1003e5858 construct_stub_invoke_deopt_addr [/opt/homebrew/Cellar/node/21.5.0/bin/node]
21: 0x10054070c Builtins_ConstructHandler [/opt/homebrew/Cellar/node/21.5.0/bin/node]
22: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
23: 0x1003e571c Builtins_InterpreterPushArgsThenFastConstructFunction [/opt/homebrew/Cellar/node/21.5.0/bin/node]
24: 0x10054070c Builtins_ConstructHandler [/opt/homebrew/Cellar/node/21.5.0/bin/node]
25: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
26: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
27: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
28: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
29: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
30: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
31: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
32: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
33: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
34: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
35: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
36: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
37: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
38: 0x1003e4b84 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
39: 0x1003e28ac Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/21.5.0/bin/node]
40: 0x1003e2594 Builtins_JSEntry [/opt/homebrew/Cellar/node/21.5.0/bin/node]
41: 0x1008f8a88 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
42: 0x1008f8480 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
43: 0x1007ec93c v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
44: 0x100639a60 node::builtins::BuiltinLoader::CompileAndCall(v8::Local<v8::Context>, char const*, node::Realm*) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
45: 0x1006d6ed0 node::Realm::ExecuteBootstrapper(char const*) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
46: 0x10061adac node::StartExecution(node::Environment*, char const*) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
47: 0x10061acc0 node::StartExecution(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
48: 0x100581fe0 node::LoadEnvironment(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
49: 0x1006a5aa0 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
50: 0x1006a583c node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/21.5.0/bin/node]
51: 0x10061ee80 node::Start(int, char**) [/opt/homebrew/Cellar/node/21.5.0/bin/node]
52: 0x183e790e0 start [/usr/lib/dyld]
Works fine when running with Node.js. Needs investigation, not sure where the Node.js process is spawned.