Out of memory react native metro bundler

536 views Asked by At

I have a simple app that's been initially created using:

react-native init AwesomeProject

I am working on windows 10 and for a long time metro would just keep crashing every minute or so. I did not notice any memory issues it just seemed to as described here: https://github.com/facebook/react-native/issues/9136#issuecomment-306131670 I followed everything here but nothing seemed to fix it so i struggled on.

However after installing fontawesome I can't even get metro to run - i have removed the dependency and it still doesn't work.

I tried increasing the memory allocation by adding

nodeExecutableAndArgs: ["node", "--max_old_space_size=8192"]

to build.gradle in /android/app but it's not done anything. With the fact my project barely has anything in it yet, I believe theres a memory issue in either metro or one of it's dependencies.

I have ample space on my machine and am at a complete loss what else to try.

I even tried this script I found to clean everything out:

del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache

Further I have closed and reopened everything, checked task manager for anything still running etc. No luck.

`C:\Users\user\Documents\React Native Training\App\App>react-native start --reset-cache --port 1234 ┌──────────────────────────────────────────────────────────────────────────────┐ │ │ │ Running Metro Bundler on port 1234. │ │ │ │ Keep Metro running while developing on any JS projects. Feel free to │ │ close this tab and run your own Metro instance if you prefer. │ │ │ │ https://github.com/facebook/react-native │ │ │ └──────────────────────────────────────────────────────────────────────────────┘

Looking for JS files in C:\Users\user\Documents\React Native Training\App\App

warning: the transform cache was reset. Loading dependency graph... <--- Last few GCs --->

[46564:000001755C6693C0] 4050 ms: Scavenge 73.5 (100.2) -> 58.9 (100.2) MB, 3.0 / 0.0 ms (average mu = 0.982, current mu = 0.982) allocation failure

<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 00007FF6F925170D]
1: InternalFrame [pc: 00007FF6F91C59EB]

Security context: 0x003081dc0911 2: next [0000003081DE29A9](this=0x00e1e0e802b1 ,0x0176d4440239 ) 3: asyncGeneratorStep(aka asyncGeneratorStep) [00000371EAAE12D9] [C:\Users\user\Documents\React Native Training\App\App\node_modules\jest-haste-map\build\index.js:193] [bytecode=0000034014D93631 offset=11](th...

FATAL ERROR: Zone Allocation failed - process out of memory 1: 00007FF6F8A1962F napi_wrap+122319 2: 00007FF6F89C2376 v8::base::CPU::has_sse+34454 3: 00007FF6F89C3036 v8::base::CPU::has_sse+37718 4: 00007FF6F91A8A1E v8::Isolate::ReportExternalAllocationLimitReached+94 5: 00007FF6F9190D6A v8::SharedArrayBuffer::Externalize+842 6: 00007FF6F8CB8E9D v8::internal::Zone::NewExpand+205 7: 00007FF6F94DCD34 v8::internal::compiler::Type::Range+116 8: 00007FF6F94DC7AD v8::internal::compiler::Type::NormalizeUnion+77 9: 00007FF6F94DB3BF v8::internal::compiler::Type::Intersect+559 10: 00007FF6F9649C26 v8::internal::compiler::OperationTyper::TypeTypeGuard+54 11: 00007FF6F9627BD6 v8::internal::compiler::TypeNarrowingReducer::Reduce+358 12: 00007FF6F952037A v8::internal::compiler::TopLevelLiveRange::MayRequireSpillRange+7930 13: 00007FF6F953D009 v8::internal::compiler::GraphReducer::Reduce+105 14: 00007FF6F953D5D4 v8::internal::compiler::GraphReducer::ReduceTop+372 15: 00007FF6F953D366 v8::internal::compiler::GraphReducer::ReduceNode+54 16: 00007FF6F952150E v8::internal::compiler::SimplifiedOperatorReducer::ReplaceUint32+3566 17: 00007FF6F951EAA1 v8::internal::compiler::TopLevelLiveRange::MayRequireSpillRange+1569 18: 00007FF6F951AF4B v8::internal::compiler::LiveRange::End+411 19: 00007FF6F90DDA77 v8::internal::Compiler::GetOptimizedCodeForOSR+1287 20: 00007FF6F90DD3D1 v8::internal::Compiler::GetFunctionFromString+2193 21: 00007FF6F90DA4A3 v8::internal::Compiler::CompileOptimized+163 22: 00007FF6F8E0F317 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+115639 23: 00007FF6F925170D v8::internal::SetupIsolateDelegate::SetupHeap+614605 24: 00007FF6F91C59EB v8::internal::SetupIsolateDelegate::SetupHeap+41899 25: 00007FF6F91F3585 v8::internal::SetupIsolateDelegate::SetupHeap+229189 26: 00007FF6F91C5BBC v8::internal::SetupIsolateDelegate::SetupHeap+42364 27: 00007FF6F91C5BBC v8::internal::SetupIsolateDelegate::SetupHeap+42364 28: 00007FF6F9219FC2 v8::internal::SetupIsolateDelegate::SetupHeap+387458 29: 00007FF6F91E4BB2 v8::internal::SetupIsolateDelegate::SetupHeap+169330 30: 00007FF6F91C33DC v8::internal::SetupIsolateDelegate::SetupHeap+32156 31: 00007FF6F906DF24 v8::internal::StackGuard::InitThread+1156 32: 00007FF6F906E033 v8::internal::StackGuard::InitThread+1427 33: 00007FF6F906E702 v8::internal::Execution::TryCall+354 34: 00007FF6F8F46A05 v8::internal::MicrotaskQueue::RunMicrotasks+517 35: 00007FF6F91C678C v8::internal::SetupIsolateDelegate::SetupHeap+45388 36: 00000003B3388D93`

0

There are 0 answers