【问题标题】:CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memoryCALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足
【发布时间】:2018-12-05 06:44:05
【问题描述】:

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

1: 节点::中止() 2: 0x10a03cc 3: v8::Utils::ReportApiFailure(char const*, char const*) 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) 5: v8::internal::Factory::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

【问题讨论】:

标签: node.js


【解决方案1】:

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

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

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

这里我将 --max-old-space-size 增加到 4GB

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-19
    • 1970-01-01
    • 2018-09-25
    • 1970-01-01
    • 2018-11-10
    • 2019-12-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多