Reputation: 23
I was able to run my react app locally without issues, however when i deployed app to heroku I got OOM errors. It's not the first time I deploy the app, however this time I add OKTA authentication which apparently cause this issue. Any advise on how to resolve this issue will be appreciated.
*2021-06-12T08:20:28.956656+00:00 app[web.1]: [] 50712 ms: Scavenge (reduce) 253.4 (257.4) -> 253.1 (257.7) MB, 32.0 / 0.0 ms (average mu = 0.729, current mu = 0.667) allocation failure
2021-06-12T08:20:28.956657+00:00 app[web.1]: [] 51247 ms: Mark-sweep (reduce) 253.7 (256.7) -> 252.2 (258.4) MB, 430.7 / 0.0 ms (+ 79.5 ms in 19 steps since start of marking, biggest step 29.6 ms, walltime since start of marking 627 ms) (average mu = 0.583, current mu = 0.254) alloca
2021-06-12T08:20:28.956657+00:00 app[web.1]:
2021-06-12T08:20:28.956657+00:00 app[web.1]: <--- JS stacktrace --->
2021-06-12T08:20:28.956658+00:00 app[web.1]:
2021-06-12T08:20:28.956667+00:00 app[web.1]: FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
2021-06-12T08:20:28.957512+00:00 app[web.1]: 1: node::Abort() [/app/.heroku/node/bin/node]
2021-06-12T08:20:28.958078+00:00 app[web.1]: 2: node::FatalError(char const*, char const*) [/app/.heroku/node/bin/node]
2021-06-12T08:20:28.958737+00:00 app[web.1]: 3: v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
2021-06-12T08:20:28.959345+00:00 app[web.1]: 4: v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]*
Upvotes: 1
Views: 4274
Reputation: 106
Try to add "NODE_OPTIONS" as key and "--max_old_space_size=1024" as value in Config Vars under project settings
NODE_OPTIONS --max_old_space_size=1024
I've found this in https://bismobaruno.medium.com/fixing-memory-heap-reactjs-on-heroku-16910e33e342
Upvotes: 8