dcaputo-harmoni / open-balena-admin

Open Balena Admin
MIT License
94 stars 20 forks source link

ui_1: JavaScript heap out of memory on startup #5

Open bernhardkaindl opened 2 years ago

bernhardkaindl commented 2 years ago

I always get this when starting, will try with environment: NODE_OPTIONS="--max-old-space-size=8192"

i_1         | webpack 5.72.0 compiled successfully in 160975 ms
postgrest_1  | 15/Apr/2022:10:42:46 +0000: Retrying listening for notifications on the pgrst channel..
postgrest_1  | 15/Apr/2022:10:42:46 +0000: Attempting to connect to the database...
postgrest_1  | 15/Apr/2022:10:42:50 +0000: Connection successful
postgrest_1  | 15/Apr/2022:10:42:50 +0000: Listening for notifications on the pgrst channel
postgrest_1  | 15/Apr/2022:10:42:50 +0000: Config re-loaded
postgrest_1  | 15/Apr/2022:10:42:54 +0000: Schema cache loaded
ui_1         | 
ui_1         | <--- Last few GCs --->
ui_1         | 
ui_1         | [27:0x565cd00]   276536 ms: Scavenge (reduce) 473.4 (488.1) -> 472.5 (488.1) MB, 1.3 / 0.0 ms  (average mu = 0.733, current mu = 0.335) allocation failure 
ui_1         | [27:0x565cd00]   279107 ms: Mark-sweep (reduce) 498.2 (512.5) -> 492.0 (509.0) MB, 1098.3 / 0.1 ms  (+ 2.8 ms in 16 steps since start of marking, biggest step 0.4 ms, walltime since start of marking 2571 ms) (average mu = 0.714, current mu = 0.676) alloca
ui_1         | 
ui_1         | <--- JS stacktrace --->
ui_1         | 
ui_1         | FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
ui_1         |  1: 0xb2e180 node::Abort() [/usr/bin/node]
ui_1         |  2: 0xa4019e node::FatalError(char const*, char const*) [/usr/bin/node]
ui_1         |  3: 0xd1fc3e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
ui_1         |  4: 0xd1ffb7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
ui_1         |  5: 0xed93e5  [/usr/bin/node]
ui_1         |  6: 0xeea82d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]
ui_1         |  7: 0xeed55e v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/node]
ui_1         |  8: 0xeaef7a v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/bin/node]
ui_1         |  9: 0x122f3d8 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/bin/node]
ui_1         | 10: 0x1632879  [/usr/bin/node]
postgrest_1  | 15/Apr/2022:10:43:40 +0000: Retrying listening for notifications on the pgrst channel..
postgrest_1  | 15/Apr/2022:10:43:40 +0000: Attempting to connect to the database...
postgrest_1  | 15/Apr/2022:10:43:40 +0000: Connection successful
postgrest_1  | 15/Apr/2022:10:43:40 +0000: Listening for notifications on the pgrst channel
postgrest_1  | 15/Apr/2022:10:43:40 +0000: Config re-loaded
postgrest_1  | 15/Apr/2022:10:43:43 +0000: Schema cache loaded
postgrest_1  | 15/Apr/2022:10:44:31 +0000: Retrying listening for notifications on the pgrst channel..
dcaputo-harmoni commented 2 years ago

@bernhardkaindl sounds like you are on the right track, let me know if that works and I’ll incorporate it in the container by default. For whatever reason I haven’t encountered that one before in my own environments.