Closed
Description
What version of Wrangler
are you using?
2.4.0
What operating system are you using?
Ubuntu, Node v16.16.0
Describe the Bug
I'm trying to publish a large Next.js website deployed with workers-sites:
export NODE_OPTIONS=--max_old_space_size=40000
wrangler publish
And I get a JavaScript heap out of memory error (below). Perhaps all of the files are loaded into memory when they are uploaded rather than being batched?
<--- Last few GCs --->
[18106:0x5ac35e0] 81912 ms: Mark-sweep (reduce) 18795.6 (19296.5) -> 18795.6 (19295.5) MB, 111.7 / 0.0 ms (average mu = 0.308, current mu = 0.366) last resort GC in old space requested
[18106:0x5ac35e0] 82043 ms: Mark-sweep (reduce) 18795.6 (19295.5) -> 18795.6 (19295.5) MB, 131.6 / 0.0 ms (average mu = 0.176, current mu = 0.000) last resort GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
1: 0xb0a860 node::Abort() [/home/user/.nvm/versions/node/v16.16.0/bin/node]
2: 0xa1c193 node::FatalError(char const*, char const*) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
3: 0xcf9a6e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
4: 0xcf9de7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
5: 0xeb1685 [/home/user/.nvm/versions/node/v16.16.0/bin/node]
6: 0xec0c58 [/home/user/.nvm/versions/node/v16.16.0/bin/node]
7: 0xec10d0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
8: 0xec404e v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
9: 0xe852c2 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
10: 0xe7d8d4 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
11: 0xe7f5e0 v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
12: 0xe9239e v8::internal::Factory::NewStringFromOneByte(v8::base::Vector<unsigned char const> const&, v8::internal::AllocationType) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
13: 0xd08745 v8::String::NewFromOneByte(v8::Isolate*, unsigned char const*, v8::NewStringType, int) [/home/user/.nvm/versions/node/v16.16.0/bin/node]
14: 0xbf607e [/home/user/.nvm/versions/node/v16.16.0/bin/node]
15: 0xae6796 [/home/user/.nvm/versions/node/v16.16.0/bin/node]
16: 0x15878ec [/home/user/.nvm/versions/node/v16.16.0/bin/node]