我突然开始出现此错误,原因不明。该应用程序运行完全正常,并且在刷新应用程序(使用hot reloading in expo
后的某个时间点,出现此错误,我需要重新启动打包程序,然后该应用程序才能再次运行。
致命错误:CALL_AND_RETRY_LAST分配失败-JavaScript堆内存不足
1: 00007FF63201F04A v8::internal::GCIdleTimeHandler::GCId
leTimeHandler+5114
2: 00007FF631FFA0C6 node::MakeCallback+4518
3: 00007FF631FFAA30 node_module_register+2032
4: 00007FF6322820EE v8::internal::FatalProcessOutOfMemory+846
5: 00007FF63228201F v8::internal::FatalProcessOutOfMemory+639
6: 00007FF6327A2BC4 v8::internal::Heap::MaxHeapGrowingFactor+9556
7: 00007FF6327A10CB v8::internal::Heap::MaxHeapGrowingFactor+2651
8: 00007FF63235CA3B v8::internal::Factory::AllocateRawWithImmortalMap+59
9: 00007FF63235F4ED v8::internal::Factory::NewRawTwoByteString+77
10: 00007FF632569AA8 v8::internal::Smi::SmiPrint+536
11: 00007FF63227582B v8::internal::StringHasher::UpdateIndex+219
12: 00007FF63229AB26 v8::String::Utf8Length+22
13: 00007FF631F518B7 v8::internal::LookupIterator::index+37719
14: 00007FF631F4DAF3 v8::internal::LookupIterator::index+21907
15: 00007FF631F4A49A v8::internal::LookupIterator::index+7994
16: 00007FF6327FC122 v8::internal::OptimizingCompileDispatcher::Unblock+59890
17: 00007FF6327FD5AD v8::internal::OptimizingCompileDispatcher::Unblock+65149
18: 00007FF6327FC606 v8::internal::OptimizingCompileDispatcher::Unblock+61142
19: 00007FF6327FC4EB v8::internal::OptimizingCompileDispatcher::Unblock+60859
20: 00000223BE85C5C1
答案 0 :(得分:0)
原因是发生的内存分配超出了节点的堆内存分配限制大小。
设置max_old_space_size选项可以增加堆内存分配限制的大小。
从 node v8.0 开始,您可以使用export NODE_OPTIONS=--max_old_space_size=4096
。