<--- Last few GCs --->
[19250:0x28db090] 338316 ms: Mark-sweep 1358.4 (1530.4) -> 1357.6 (1530.4) MB, 4703.7 / 0.0 ms allocation failure GC in old space requested
[19250:0x28db090] 340800 ms: Mark-sweep 1357.6 (1530.4) -> 1357.5 (1462.9) MB, 2483.3 / 0.0 ms last resort GC in old space requested
[19250:0x28db090] 343628 ms: Mark-sweep 1357.5 (1462.9) -> 1357.5 (1447.9) MB, 2827.1 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x18172b0a58b9 <JSObject>
2: _assign(aka _assign) [/home/rapidgenomics/Apps/LIMS/mean/node_modules/mongoose/lib/model.js:4183] [bytecode=0x3229ad46f471 offset=708](this=0x174d0f5822d1 <undefined>,err=0x174d0f582201 <null>,vals=0x145e731935b9 <JSArray[21554]>,mod=0xcc5d9aefff9 <Object map = 0x140aa8af76e1>,assignmentOpts=0x380059b28211 <Object map = 0x140aa8afc2d9>)
3: next(aka next) [/home/rapidgenomics/Apps/LIMS...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/usr/bin/node]
2: 0x8ccf9c [/usr/bin/node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [/usr/bin/node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/bin/node]
5: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/usr/bin/node]
6: v8::internal::HashTable<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::New(v8::internal::Isolate*, int, v8::internal::PretenureFlag, v8::internal::MinimumCapacity) [/usr/bin/node]
7: v8::internal::HashTable<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::EnsureCapacity(v8::internal::Handle<v8::internal::NameDictionary>, int, v8::internal::PretenureFlag) [/usr/bin/node]
8: v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::EnsureCapacity(v8::internal::Handle<v8::internal::NameDictionary>, int) [/usr/bin/node]
9: v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::Add(v8::internal::Handle<v8::internal::NameDictionary>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDetails, int*) [/usr/bin/node]
10: v8::internal::LookupIterator::ApplyTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>) [/usr/bin/node]
11: v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow, v8::internal::Object::StoreFromKeyed) [/usr/bin/node]
12: v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed) [/usr/bin/node]
13: v8::internal::Runtime_SetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
14: 0x19a0ec2042fd
对于特定的页面加载,该错误一直发生,即使在项目的根目录中使用node --max_old_space_size=4096 server.js
或increase-memory-limit
命令增加了内存之后,该错误仍在生产中失败。
相同的解决方案可以在我的本地开发环境中使用。
我该如何解决?