fix(ci): 解决 Run#55 Nitro 再次 OOM:提升堆上限到 10G 并禁用压缩/minify
- NODE_OPTIONS max-old-space-size 8192 → 10240,新增 --gc-interval=100000 主动 GC - 构建前 drop_caches 清理页面缓存,降低系统级 RSS 压力 - 禁用 NITRO_MINIFY 与 DISABLE_ROLLDOWN,进一步降低峰值内存 - 构建前后打印内存快照,便于后续排障
This commit is contained in:
@@ -64,8 +64,10 @@ jobs:
|
||||
NODE_MAJOR: "22"
|
||||
NODE_VERSION_FALLBACK: "22.13.0"
|
||||
NODE_MIRROR_PRIMARY: "https://registry.npmmirror.com/-/binary/node"
|
||||
NODE_OPTIONS: "--max-old-space-size=8192 --no-warnings --expose-gc"
|
||||
NODE_OPTIONS: "--max-old-space-size=10240 --no-warnings --expose-gc --gc-interval=100000"
|
||||
NITRO_PRESET: "node-server"
|
||||
DISABLE_ROLLDOWN: "1"
|
||||
NITRO_MINIFY: "false"
|
||||
steps:
|
||||
- name: 安装基础运行依赖(git/curl/ca-certificates/tar/xz-utils,Runner 自带)
|
||||
run: |
|
||||
@@ -198,13 +200,18 @@ jobs:
|
||||
set -euxo pipefail
|
||||
echo "=== 构建前系统内存状态 ==="
|
||||
free -h || true
|
||||
sync && echo 3 > /proc/sys/vm/drop_caches 2>/dev/null || true
|
||||
echo "=== 开始执行 nuxt build ==="
|
||||
export NODE_OPTIONS="--max-old-space-size=8192 --no-warnings --expose-gc"
|
||||
export NODE_OPTIONS="--max-old-space-size=10240 --no-warnings --expose-gc --gc-interval=100000"
|
||||
export NITRO_PRESET=node-server
|
||||
export NITRO_MINIFY=false
|
||||
export DISABLE_ROLLDOWN=1
|
||||
npm run build
|
||||
echo "=== 构建完成,.output/ 生成结果 ==="
|
||||
ls -la .output/ 2>/dev/null || true
|
||||
du -sh .output 2>/dev/null || true
|
||||
echo "=== 构建后内存状态 ==="
|
||||
free -h || true
|
||||
|
||||
build-image:
|
||||
name: 构建并推送容器镜像
|
||||
|
||||
Reference in New Issue
Block a user