我正在运行一个NodeJS程序,以从MongoDB数据库中提取数据,看来这对于内存来说太多了。 我尝试了一些在网上看到的“空间大小= 4096”,但是它不起作用。我仍然收到以下错误:年轻对象提升失败分配失败-JavaScript堆内存不足。 有人可以帮我吗?
{
_id: 566ab89538161a0d1c5a6520,
idStr: '566ab89538161a0d1c5a6520',
Label: 'Redaktions Reporting',
Owner: 'xxx@xxx',
UserId: 520924,
OrgaCode: 'xxx',
CreateDate: '20151211115045',
LastSeen: 2020-11-04T16:22:33.000Z,
nbWidgets: 260,
nbTabs: 7,
SharedUserId: 524468,
SharedUserMail: 'xxx@xxx',
ShareType: ''
},
... 4201639 more items
]
<--- Last few GCs --->
u [31288:00000212B3B69F10] 1320596 ms: Mark-sweep (reduce) 4095.6 (4105.2) -> 4095.6 (4105.9) MB, 4855.4 / 0.0 ms (+ 0.0 ms in 16 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 4859 ms) (average mu = 0.671, current mu =[31288:00000212B3B69F10] 1325499 ms: Mark-sweep (reduce) 4096.6 (4102.9) -> 4096.5 (4104.9) MB, 4805.4 / 0.0 ms (+ 93.1 ms in 16 steps since start of marking, biggest step 18.9 ms, walltime since start of marking 4904 ms) (average mu = 0.459, current mu
<--- JS stacktrace --->
FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
1: 00007FF71641131F napi_wrap+109119
2: 00007FF7163B6686 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet,1>::NumberOfElementsOffset+33350
3: 00007FF7163B7456 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet,1>::NumberOfElementsOffset+36886
4: 00007FF716C8589E v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF716C6A6ED v8::SharedArrayBuffer::Externalize+781
6: 00007FF716B14B2C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1516
7: 00007FF716AFF6CB v8::internal::NativeContextInferrer::Infer+59339
8: 00007FF716AE4AFF v8::internal::MarkingWorklists::SwitchToContextSlow+57503
9: 00007FF716AF885B v8::internal::NativeContextInferrer::Infer+31067
10: 00007FF716AEF8ED v8::internal::MarkCompactCollector::EnsureSweepingCompleted+6269
11: 00007FF716AF7AAE v8::internal::NativeContextInferrer::Infer+27566
12: 00007FF716AFBA2B v8::internal::NativeContextInferrer::Infer+43819
13: 00007FF716B05262 v8::internal::ItemParallelJob::Task::RunInternal+18
14: 00007FF716B051E3 v8::internal::ItemParallelJob::Run+643
15: 00007FF716AD8963 v8::internal::MarkingWorklists::SwitchToContextSlow+7939
16: 00007FF716AEFDAC v8::internal::MarkCompactCollector::EnsureSweepingCompleted+7484
17: 00007FF716AEE5E4 v8::internal::MarkCompactCollector::EnsureSweepingCompleted+1396
18: 00007FF716AEC0F8 v8::internal::MarkingWorklists::SwitchToContextSlow+87704
19: 00007FF716B1A8D1 v8::internal::Heap::LeftTrimFixedArray+929
20: 00007FF716B1C9B5 v8::internal::Heap::PageFlagsAreConsistent+789
21: 00007FF716B11BD1 v8::internal::Heap::CollectGarbage+2033
22: 00007FF716B0FDD5 v8::internal::Heap::AllocateExternalBackingStore+1365
23: 00007FF716B302F7 v8::internal::Factory::NewFillerObject+183
24: 00007FF71685DB51 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+1409
25: 00007FF716D0E6DD v8::internal::SetupIsolateDelegate::SetupHeap+463949
26: 00007FF716D0F58D v8::internal::SetupIsolateDelegate::SetupHeap+467709
27: 0000035B98B4EE2C
非常感谢您的任何建议!