Skip to content

fix: prevent Bazel OOM crash on CI runners#1147

Merged
lacolaco merged 2 commits intoangular:mainfrom
lacolaco:fix/ci-build-stability
Feb 24, 2026
Merged

fix: prevent Bazel OOM crash on CI runners#1147
lacolaco merged 2 commits intoangular:mainfrom
lacolaco:fix/ci-build-stability

Conversation

@lacolaco
Copy link
Collaborator

Summary

  • CIワークフローでBazelがOOMでクラッシュする問題を修正

変更内容

リソース制限(CI workflows):

  • RAM: 6GB(GitHub Actions ubuntu-latestは7GB)
  • CPU: 2
  • 並列ジョブ: 4
  • JVMヒープ: 最大2GB
  • ビルド後に分析キャッシュを破棄してメモリ圧迫を軽減

ビルド出力検証(adev.ts):

  • Bazelがシグナルで終了した際に終了コード0を返す場合があるため、
    ビルド出力ディレクトリの存在を確認してサイレント失敗を検出

影響範囲

  • CI workflowsのみ(.github/workflows/
  • ローカル開発環境には影響なし

- Add resource limits to all CI workflows' bazelrc configuration:
  - Limit RAM to 6GB (GitHub Actions ubuntu-latest has 7GB)
  - Limit CPUs to 2
  - Limit parallel jobs to 4
  - Reduce JVM heap to 2GB max
  - Discard analysis cache after build to reduce memory pressure

- Add build output verification in adev.ts to detect silent failures
  when Bazel server is killed mid-build
- Move _JAVA_OPTIONS and NODE_OPTIONS to build step env
- Remove startup options from bazelrc (use _JAVA_OPTIONS instead)
- Reduce local_ram_resources to 4096MB
- Reduce jobs to 2
@lacolaco lacolaco force-pushed the fix/ci-build-stability branch from f5e8875 to 22316dc Compare February 24, 2026 03:56
@lacolaco lacolaco merged commit 0602285 into angular:main Feb 24, 2026
7 checks passed
@lacolaco lacolaco deleted the fix/ci-build-stability branch February 24, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant