Skip to content

Next.JS: makes build consume max heap memory #248

@statusunknown418

Description

@statusunknown418

Running OS

MacOS

Running Node Version

20.17

Description

I'm completely blocked from using this in a next route handler (next 15) as it just won't compile and instead throw this error

<--- Last few GCs --->

[24780:0x138008000]   108368 ms: Mark-Compact 4062.9 (4140.2) -> 4061.2 (4142.8) MB, 985.79 / 0.00 ms  (average mu = 0.330, current mu = 0.004) allocation failure; scavenge might not succeed
[24780:0x138008000]   110576 ms: Mark-Compact 4065.2 (4142.8) -> 4063.2 (4152.8) MB, 2203.71 / 0.00 ms  (average mu = 0.153, current mu = 0.002) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

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

 1: 0x1049db5a4 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
 2: 0x104b6404c v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
 3: 0x104d38720 v8::internal::Heap::GarbageCollectionReasonToString(v8::internal::GarbageCollectionReason) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
 4: 0x104d371fc v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
 5: 0x104d2da14 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
 6: 0x104d2e274 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
 7: 0x104d132e4 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
 8: 0x1050faff4 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
 9: 0x105458c44 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
10: 0x1054593fc Builtins_StringAdd_CheckNone [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
11: 0x10a6ebe88 
12: 0x10a990be4 
13: 0x10a98e784 
14: 0x10a812218 
15: 0x10a9a43e4 
16: 0x10a96ddd4 
17: 0x10a9b116c 
18: 0x10a96dd1c 
19: 0x10a773a6c 
20: 0x10a7733d0 
21: 0x1053ce50c Builtins_JSEntryTrampoline [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
22: 0x1053ce1f4 Builtins_JSEntry [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
23: 0x104ca5bc8 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
24: 0x104ca5014 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>*) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
25: 0x104b7f904 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
26: 0x104904fa0 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/a3tech/.nvm/versions/node/v20.17.0/bin/node]
27: 0x10491b068 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
28: 0x1049e0d80 node::fs::FSReqCallback::Resolve(v8::Local<v8::Value>) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
29: 0x1049e2848 node::fs::AfterScanDir(uv_fs_s*) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
30: 0x1049d5430 node::MakeLibuvRequestCallback<uv_fs_s, void (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
31: 0x1053abb00 uv__work_done [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
32: 0x1053af550 uv__async_io [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
33: 0x1053c1628 uv__io_poll [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
34: 0x1053afb14 uv_run [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
35: 0x1049056f0 node::SpinEventLoopInternal(node::Environment*) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
36: 0x104a1b3f0 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
37: 0x104a1b104 node::NodeMainInstance::Run() [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
38: 0x1049a2fa0 node::Start(int, char**) [/Users/a3tech/.nvm/versions/node/v20.17.0/bin/node]
39: 0x1952c6b98 start [/usr/lib/dyld]

Expected behavior

Steps to reproduce

IT should let me build my app

Were you able to verify it by using (and changing) the examples?

No

If yes, which changes did you apply?

Other details

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions