CALL_AND_RETRY_LAST分配失败-JavaScript堆内存不足

时间:2018-06-26 13:56:25

标签: node.js

致命错误:CALL_AND_RETRY_LAST分配失败-JavaScript堆内存不足

1: node :: Abort() 2: 0x10a03cc 3: v8 :: Utils :: ReportApiFailure(char const *,char const *) 4: v8 :: internal :: V8 :: FatalProcessOutOfMemory(char const *,bool) 5: v8 ::内部::工厂:: NewTransitionArray(int) 6: v8 :: internal :: TransitionArray :: Insert(v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: SimpleTransitionFlag) 7: v8 :: internal :: Map :: CopyReplaceDescriptors(v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: TransitionFlag,v8 :: internal :: MaybeHandle ,char const *,v8 :: internal :: SimpleTransitionFlag) 8: v8 :: internal :: Map :: CopyAddDescriptor(v8 :: internal :: Handle,v8 :: internal :: Descriptor *,v8 :: internal :: TransitionFlag) 9: v8 :: internal :: Map :: CopyWithConstant(v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: PropertyAttributes,v8 :: internal :: TransitionFlag ) 10: v8 :: internal :: Map :: TransitionToDataProperty(v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: PropertyAttributes,v8 :: internal :: Object :: StoreFromKeyed) 11: v8 :: internal :: LookupIterator :: PrepareTransitionToDataProperty(v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: PropertyAttributes,v8 :: internal :: Object :: StoreFromKeyed) 12: v8 :: internal :: StoreIC :: LookupForWrite(v8 :: internal :: LookupIterator *,v8 :: internal :: Handle,v8 :: internal :: Object :: StoreFromKeyed) 13: v8 :: internal :: StoreIC :: UpdateCaches(v8 :: internal :: LookupIterator *,v8 :: internal :: Handle,v8 :: internal :: Object :: StoreFromKeyed) 14: v8 :: internal :: StoreIC :: Store(v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: Object :: StoreFromKeyed) 15: v8 :: internal :: KeyedStoreIC :: Store(v8 :: internal :: Handle,v8 :: internal :: Handle,v8 :: internal :: Handle) 16: v8 :: internal :: Runtime_KeyedStoreIC_Miss(int,v8 :: internal :: Object **,v8 :: internal :: Isolate *) 17:0x218d5a6092a7

1 个答案:

答案 0 :(得分:0)

通常,当堆的旧空间大小由于内存使用异常而不足以运行进程时,会发生这种情况。

在命令行中启动node.js代码时,可以通过如下增加旧空间大小来解决此问题。

node --max-old-space-size=4096 index.js

在这里,我将--max-old-space-size增大为4GB