Skip to content

CI lint job が type-aware ESLint の heap 上限到達で OOM することがある #376

Description

@YusukeHirao

現象

CI の lint job(lint:eslint:check、type-aware ESLint ルール @typescript-eslint / jsdoc/no-undefined-types 等を使用)が、変更ファイル数が多いときに以下のエラーで失敗することがある。

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

runner のばらつきで通ることもあり、リトライで回避できる場合がある。

原因

lint:eslint:check は各パッケージの lib/*.d.ts を読み込みモノレポ全体の型情報をメモリに展開する。ファイル数が増えるほど必要メモリが増え、Node のデフォルトヒープ上限(実測 ~4GB)付近に達する。モノレポが育ってきたことによる構造的な問題で、特定の変更のバグではない。

ローカルで NODE_OPTIONS=--max-old-space-size=8192 を付けると安定して通ることを確認済み。

対処案

.github/workflows/ci.yml の lint job に NODE_OPTIONS=--max-old-space-size=8192(または適切な値)を設定する。

影響範囲

lint job の実行環境設定のみ。プロダクションコードへの影響なし。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions