cli icon indicating copy to clipboard operation
cli copied to clipboard

"react-native start" ends with "out of memory"-failure on Node >=12.5

Open PK-INTENSIO opened this issue 7 years ago • 23 comments

EDIT: Workaround

Downgrade to Node 12.4, see https://github.com/react-native-community/cli/issues/485#issuecomment-509210382.

Environment

System: OS: Windows 10 CPU: (4) x64 Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz Memory: 5.40 GB / 7.88 GB Binaries: Node: 12.6.0 - C:\Program Files\nodejs\node.EXE npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5522156

Description

"react-native start" ends with "out of memory"-failure

C:\Temp\FRNA>react-native start ┌──────────────────────────────────────────────────────────────────────────────┐ │ │ │ Running Metro Bundler on port 8081. │ │ │ │ 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:\Temp\FRNA

Loading dependency graph... <--- Last few GCs --->

[3844:00000135069CA290] 9074 ms: Scavenge 65.9 (93.0) -> 51.0 (93.0) MB, 4.1 / 0.0 ms (average mu = 0.998, current mu = 0.998) allocation failure

<--- JS stacktrace --->

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

0: ExitFrame [pc: 00007FF6C4CF170D]
1: InternalFrame [pc: 00007FF6C4C659EB]

Security context: 0x029a341c0911 2: next [0000029A341E29A9](this=0x02a8d7380881 ,0x022c4d995851 <JSArray[18398]>) 3: asyncGeneratorStep(aka asyncGeneratorStep) [000000039D6EBEA1] [C:\Temp\FRNA\node_modules\jest-haste-map\build\index.js:193] [bytecode=00000340235B2529 offset=11](this=0x00bbe6dc04d1 ,0x02a8d7380881 ...

FATAL ERROR: Zone Allocation failed - process out of memory 1: 00007FF6C44B962F 2: 00007FF6C4462376 3: 00007FF6C4463036 4: 00007FF6C4C48A1E 5: 00007FF6C4C30D6A 6: 00007FF6C4758E9D 7: 00007FF6C4F7CD34 8: 00007FF6C4F7C7AD 9: 00007FF6C4F7B3BF 10: 00007FF6C50E9C26 11: 00007FF6C50C7BD6 12: 00007FF6C4FC037A 13: 00007FF6C4FDD009 14: 00007FF6C4FDD5D4 15: 00007FF6C4FDD366 16: 00007FF6C4FC150E 17: 00007FF6C4FBEAA1 18: 00007FF6C4FBAF4B 19: 00007FF6C4B7DA77 20: 00007FF6C4B7D3D1 21: 00007FF6C4B7A4A3 22: 00007FF6C48AF317 23: 00007FF6C4CF170D 24: 00007FF6C4C659EB 25: 00007FF6C4C93585 26: 00007FF6C4C65BBC 27: 00007FF6C4C65BBC 28: 00007FF6C4CB9FC2 29: 00007FF6C4C84BB2 30: 00007FF6C4C633DC 31: 00007FF6C4B0DF24 32: 00007FF6C4B0E033 33: 00007FF6C4B0E702 34: 00007FF6C49E6A05 35: 00007FF6C4C6678C 36: 00000268F35536F3

Reproducible Demo

run "react-native init FRNA" run "react-native start"

PK-INTENSIO avatar Jul 05 '19 14:07 PK-INTENSIO

still an issue on node 12.8.1

DanielTate avatar Aug 21 '19 09:08 DanielTate

@DanielTate there was nothing in the 12.8.1 changelog that would have led me to believe it would change. Here's what will cause it to change:

  • jest 24.9+ needs to be in your project, that may happen but requires facebook-internal changes https://github.com/facebook/metro/pull/445#issuecomment-523347315
  • Node upgrades V8 and releases 12.9 - looks like they did! https://github.com/nodejs/node/pull/28955#issuecomment-521908956

Could you test this on Node 12.9 and see if it fixes it for you? That would be news

mikehardy avatar Aug 21 '19 13:08 mikehardy

@mikehardy I tested on node lastest release (v12.10.0) and it work! thanks.

dbw03135 avatar Sep 19 '19 02:09 dbw03135