繁体   English   中英

Github 操作失败:无效标记压缩接近堆限制分配失败 - JavaScript 堆出 memory

[英]Github actions fails: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

在构建库文件时,我不断收到 memory 错误。 通过运行此命令export NODE_OPTIONS="--max-old-space-size=8192"在我的本地环境中解决了此问题。

但是,无论我在 Github 工作流文件中增加多少--max-old-space-size ,那里都没有工作,它继续构建特定组件,然后失败并出现以下错误:


<--- Last few GCs --->

[3238:0x62dbb30]   103974 ms: Scavenge (reduce) 2038.5 (2082.4) -> 2038.3 (2083.4) MB, 4.0 / 0.0 ms  (average mu = 0.080, current mu = 0.002) allocation failure 
[3238:0x62dbb30]   105675 ms: Mark-sweep (reduce) 2039.2 (2083.4) -> 2036.6 (2083.1) MB, 1697.7 / 0.0 ms  (average mu = 0.054, current mu = 0.014) allocation failure scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa89e60 node::Abort() [node]
 2: 0x9ade29 node::FatalError(char const*, char const*) [node]
 3: 0xc7583e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xc75bb7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xe3f6d5  [node]
 6: 0xe4027c  [node]
 7: 0xe4dc0b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 8: 0xe5190c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 9: 0xe157da v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
10: 0x116d4ab v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x15045f9  [node]
Aborted (core dumped)

工作流文件:build.yml

name: Build

on:
  push:
    tags: 
      - "v*"

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [15.x]
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm ci
      - run: export NODE_OPTIONS="--max-old-space-size=16384" # tried to increase it more but all fails
      - run: npm run build

通过将node-version更改为14.x解决了该问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM