AWS代码管道错误致命错误:接近堆限制的无效标记压缩分配失败-JavaScript堆内存不足

2023-12-02

我有在 aws 代码管道上运行的角度应用程序,突然它开始抛出此错误。我做了很多这样的事情,包括“node --max-old-space-size=8192”等..!但没有任何方法可以解决此错误。有人可以帮我解决这个问题吗?

   To disable this warning use "ng config -g cli.warnings.versionMismatch false".

<--- Last few GCs --->

[181:0x4ab9280]    99247 ms: Mark-sweep 2028.9 (2081.8) -> 2018.6 (2087.2) MB, 1481.7 / 0.0 ms  (average mu = 0.125, current mu = 0.028) allocation failure scavenge might not succeed
[181:0x4ab9280]   100721 ms: Mark-sweep 2021.2 (2087.2) -> 2018.5 (2087.0) MB, 1464.8 / 0.0 ms  (average mu = 0.069, current mu = 0.006) allocation failure GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x13cb519]
Security context: 0x1308cef008d1 <JSObject>
    1: add [0x1308cef0b101](this=0x09332a9b8e61 <Set map = 0x33764a780a29>,0x22118ef17ee9 <Scope map = 0x12cadd78a529>)
    2: addScopeSymbols1(aka addScopeSymbols1) [0x27c6ba252f61] [/codebuild/output/src879897097/src/node_modules/webpack/lib/optimize/ConcatenatedModule.js:~207] [pc=0x36ab68da2da6](this=0x09e7d26004b1 <undefined>,0x22118ef17ee9 <Scope map = 0x12...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa07f90 node::Abort() [ng build --configuration DEV]
 2: 0xa0839c node::OnFatalError(char const*, char const*) [ng build --configuration DEV]
 3: 0xb80d9e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng build --configuration DEV]
 4: 0xb81119 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng build --configuration DEV]
 5: 0xd2d875  [ng build --configuration DEV]
 6: 0xd2df06 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [ng build --configuration DEV]
 7: 0xd3a785 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [ng build --configuration DEV]
 8: 0xd3b635 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng build --configuration DEV]
 9: 0xd3e0ec v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [ng build --configuration DEV]
10: 0xd0502d v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::RootIndex, int, v8::internal::Object, v8::internal::AllocationType) [ng build --configuration DEV]
11: 0xd05120 v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::RootIndex, int, v8::internal::AllocationType) [ng build --configuration DEV]
12: 0xf325bd v8::internal::OrderedHashTable<v8::internal::OrderedHashSet, 1>::Allocate(v8::internal::Isolate*, int, v8::internal::AllocationType) [ng build --configuration DEV]
13: 0xf3266f v8::internal::OrderedHashTable<v8::internal::OrderedHashSet, 1>::Rehash(v8::internal::Isolate*, v8::internal::Handle<v8::internal::OrderedHashSet>, int) [ng build --configuration DEV]
14: 0xf32c4b v8::internal::OrderedHashTable<v8::internal::OrderedHashSet, 1>::EnsureGrowable(v8::internal::Isolate*, v8::internal::Handle<v8::internal::OrderedHashSet>) [ng build --configuration DEV]
15: 0x1029ac8 v8::internal::Runtime_SetGrow(int, unsigned long*, v8::internal::Isolate*) [ng build --configuration DEV]
16: 0x13cb519  [ng build --configuration DEV]
Aborted

[Container] 2020/12/13 15:41:31 Command did not exit successfully ng build --configuration $ENV exit status 134
[Container] 2020/12/13 15:41:31 Phase complete: BUILD State: FAILED
[Container] 2020/12/13 15:41:31 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: ng build --configuration $ENV. Reason: exit status 134

如果你使用的是 aws 我用这个解决了它

Solution

1 从 aws 控制台转到您的管道

2 单击编辑 然后单击编辑构建阶段 然后点击那个铅笔图标

3 添加环境变量 名称 - “NODE_OPTIONS” 值 - “--max-old-space-size=8192” 类型 - “纯文本” 单击完成并保存。

4 单击发布更改它将再次启动您的管道

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

AWS代码管道错误致命错误:接近堆限制的无效标记压缩分配失败-JavaScript堆内存不足 的相关文章

随机推荐