FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
每当我使用 ng build 构建时,我都会收到以下错误。我正在处理的项目是 angular 12 with primeface 模板。
我尝试了以下方法,但没有用
set NODE_OPTIONS=--max-old-space-size=8192
<--- Last few GCs --->
[20368:00000209E3C2B160] 34896 ms: Mark-sweep (reduce) 4092.5 (4101.4) -> 4092.1 (4106.9) MB, 3198.8 / 0.0 ms (+ 0.1 ms in 291 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 3322 ms) (average mu = 0.254, current mu [20368:00000209E3C2B160] 40386 ms: Mark-sweep (reduce) 4093.1 (4104.9) -> 4092.7 (4105.2) MB, 5489.4 / 0.1 ms (average mu = 0.102, current mu = 0.000) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
1: 00007FF7AF4F428F napi_wrap+133311
2: 00007FF7AF48DE66 SSL_get_quiet_shutdown+63062
3: 00007FF7AF48ECFD node::OnFatalError+301
4: 00007FF7AFD71B2E v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF7AFD5691D v8::SharedArrayBuffer::Externalize+781
6: 00007FF7AFC0012C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1516
7: 00007FF7AFBEABAB v8::internal::NativeContextInferrer::Infer+59739
8: 00007FF7AFBCFE7F v8::internal::MarkingWorklists::SwitchToContextSlow+56975
9: 00007FF7AFBE3B6B v8::internal::NativeContextInferrer::Infer+31003
10: 00007FF7AFBDAC4D v8::internal::MarkCompactCollector::EnsureSweepingCompleted+6285
11: 00007FF7AFBE2DBE v8::internal::NativeContextInferrer::Infer+27502
12: 00007FF7AFBE6E0B v8::internal::NativeContextInferrer::Infer+43963
13: 00007FF7AFBF0802 v8::internal::ItemParallelJob::Task::RunInternal+18
14: 00007FF7AFBF0791 v8::internal::ItemParallelJob::Run+641
15: 00007FF7AFBC3DF3 v8::internal::MarkingWorklists::SwitchToContextSlow+7683
16: 00007FF7AFBDB0FC v8::internal::MarkCompactCollector::EnsureSweepingCompleted+7484
17: 00007FF7AFBD9934 v8::internal::MarkCompactCollector::EnsureSweepingCompleted+1396
18: 00007FF7AFBD74A8 v8::internal::MarkingWorklists::SwitchToContextSlow+87224
19: 00007FF7AFC05F11 v8::internal::Heap::LeftTrimFixedArray+929
20: 00007FF7AFC08005 v8::internal::Heap::PageFlagsAreConsistent+789
21: 00007FF7AFBFD221 v8::internal::Heap::CollectGarbage+2049
22: 00007FF7AFBFB425 v8::internal::Heap::AllocateExternalBackingStore+1349
23: 00007FF7AFC1B89B v8::internal::Factory::NewFillerObject+203
24: 00007FF7AF94A0E1 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+1409
25: 00007FF7AFDFCF5D v8::internal::SetupIsolateDelegate::SetupHeap+474253
26: 00000048464760F0
所以我知道这是一个语法错误,因为我没有安装任何包或对项目进行任何更改。
原来我找到了代码示例
<div class="p-field" *ngIf="column.fieldType =='date'">
<label [for]="column.field">{{column.header}}</label>
<p-calendar [id]="column.field"
[(ngModel)]="selectedItem[column.field] | date:'dd/MM/yyyy hh:mm a'"
[showIcon]="true" [required]="column.required" [name]="column.field">
</p-calendar>
</div>
如果我从 ngModel 中删除以下内容,代码将编译。
| date:'dd/MM/yyyy hh:mm a'
每当我使用 ng build 构建时,我都会收到以下错误。我正在处理的项目是 angular 12 with primeface 模板。
我尝试了以下方法,但没有用
set NODE_OPTIONS=--max-old-space-size=8192
<--- Last few GCs --->
[20368:00000209E3C2B160] 34896 ms: Mark-sweep (reduce) 4092.5 (4101.4) -> 4092.1 (4106.9) MB, 3198.8 / 0.0 ms (+ 0.1 ms in 291 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 3322 ms) (average mu = 0.254, current mu [20368:00000209E3C2B160] 40386 ms: Mark-sweep (reduce) 4093.1 (4104.9) -> 4092.7 (4105.2) MB, 5489.4 / 0.1 ms (average mu = 0.102, current mu = 0.000) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
1: 00007FF7AF4F428F napi_wrap+133311
2: 00007FF7AF48DE66 SSL_get_quiet_shutdown+63062
3: 00007FF7AF48ECFD node::OnFatalError+301
4: 00007FF7AFD71B2E v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF7AFD5691D v8::SharedArrayBuffer::Externalize+781
6: 00007FF7AFC0012C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1516
7: 00007FF7AFBEABAB v8::internal::NativeContextInferrer::Infer+59739
8: 00007FF7AFBCFE7F v8::internal::MarkingWorklists::SwitchToContextSlow+56975
9: 00007FF7AFBE3B6B v8::internal::NativeContextInferrer::Infer+31003
10: 00007FF7AFBDAC4D v8::internal::MarkCompactCollector::EnsureSweepingCompleted+6285
11: 00007FF7AFBE2DBE v8::internal::NativeContextInferrer::Infer+27502
12: 00007FF7AFBE6E0B v8::internal::NativeContextInferrer::Infer+43963
13: 00007FF7AFBF0802 v8::internal::ItemParallelJob::Task::RunInternal+18
14: 00007FF7AFBF0791 v8::internal::ItemParallelJob::Run+641
15: 00007FF7AFBC3DF3 v8::internal::MarkingWorklists::SwitchToContextSlow+7683
16: 00007FF7AFBDB0FC v8::internal::MarkCompactCollector::EnsureSweepingCompleted+7484
17: 00007FF7AFBD9934 v8::internal::MarkCompactCollector::EnsureSweepingCompleted+1396
18: 00007FF7AFBD74A8 v8::internal::MarkingWorklists::SwitchToContextSlow+87224
19: 00007FF7AFC05F11 v8::internal::Heap::LeftTrimFixedArray+929
20: 00007FF7AFC08005 v8::internal::Heap::PageFlagsAreConsistent+789
21: 00007FF7AFBFD221 v8::internal::Heap::CollectGarbage+2049
22: 00007FF7AFBFB425 v8::internal::Heap::AllocateExternalBackingStore+1349
23: 00007FF7AFC1B89B v8::internal::Factory::NewFillerObject+203
24: 00007FF7AF94A0E1 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+1409
25: 00007FF7AFDFCF5D v8::internal::SetupIsolateDelegate::SetupHeap+474253
26: 00000048464760F0
所以我知道这是一个语法错误,因为我没有安装任何包或对项目进行任何更改。
原来我找到了代码示例
<div class="p-field" *ngIf="column.fieldType =='date'">
<label [for]="column.field">{{column.header}}</label>
<p-calendar [id]="column.field"
[(ngModel)]="selectedItem[column.field] | date:'dd/MM/yyyy hh:mm a'"
[showIcon]="true" [required]="column.required" [name]="column.field">
</p-calendar>
</div>
如果我从 ngModel 中删除以下内容,代码将编译。
| date:'dd/MM/yyyy hh:mm a'