gap CLI heap still grows during a klona run after #61 (87 to 821 MB after GC; unattributed)

オープン
#80 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
18/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, node.js, vite

調査の方向性

Start in packages/oracles/oracle-gaps/index.mjs and read the retention fixes from #61 plus the two probes, probe-gc.mjs and peak.mjs, to see what is already measured. Reproduce with the SAMPLE_FILE run at seed 20261112 and contexts 2, then take a late heap snapshot near 700 MB and walk the retainer path for the 217-to-821 MB growth that #61's counters do not cover. Done means the growth is attributed to a named structure, not that it is fixed; check whether it tracks klona's per-file working set rather than residue.

索引モデルが issue の本文から書いたものです。

説明

Summary

On the klona four-file suite (295 mutants, 2 contexts, seed 20261112), the gap CLI's child heap still grows during a run, after the retention fixes in #61. Heap after a forced GC, sampled every 2 s in the check child, went from about 87 MB at the start to about 217 MB in the middle and about 821 MB near the end. The run passes at a 1024 MB cap (child peak 930 MB) and completes at 1536 MB (child peak 985 MB). Main (before #61) fails at 2048 MB with a heap-limit fatal.

The growth is not attributed. The retention counters that #61 checks (Vitest's filesMap, pathsSet, idMap, the Vite copy nodes, the cold store, the stale context totals) stay at zero after each batch, so the remaining growth is in something those counters do not measure.

Measurement

Commit: 2b7efe6 on fix/gap-cli-retention (#61). Probe: the heap sampler preload (--expose-gc, forced GC every 2 s, main thread of the check child only).

# heap after GC, first / middle / last samples
cd <checkout of 2b7efe6>/packages/oracles/oracle-gaps
SAMPLE_FILE=/tmp/heap.jsonl node --expose-gc --import ./probe-gc.mjs ./index.mjs \
  --package <klona> --source src/index.js,src/lite.js,src/full.js,src/json.js \
  --seed 20261112 --contexts 2 --mutants <mutants dir> --out <out>

# child peak heap, no probe, cap at 1024 and 1536 MB
node --max-old-space-size=1024 --import ./peak.mjs ./index.mjs <same args>
node --max-old-space-size=1536 --import ./peak.mjs ./index.mjs <same args>

probe-gc.mjs samples process.memoryUsage().heapUsed after globalThis.gc() every 2 s, in the child only (ORACLE_GAPS_GROUP set). peak.mjs samples v8.getHeapStatistics().used_heap_size every 250 ms and prints the peak at exit.

Numbers, from the local runs against 67f057d/59363c8 code:

  • heap after GC: 87 MB (first sample), 217 MB (middle), 821 MB (last sample before exit);
  • 1024 MB cap: exit 0, child peak 930 MB;
  • 1536 MB cap: exit 0, child peak 985 MB;
  • default 2048 MB heap on main (affeb1a): heap-limit fatal, done error ... ran out of memory.

What is ruled out

  • Vitest state entries of retired copies (filesMap, pathsSet, idMap): 0 after each batch.
  • Vite module nodes of retired copies: 0 after each batch.
  • Vite nodes of non-copy files: at most one per file (the query-stripped check in #61).
  • The cold run's store (memoryStore): keeps nothing.
  • Vite's transform text, measured as a size on ce6c93d: flat.

What is not known

  • Which structure holds the second-half growth (from 217 to 821 MB). A late heap snapshot, taken near 700 MB, is the next step; its retainer path is not yet checked.
  • Whether the growth follows klona's per-file working set (later files have more mutants and larger tests) rather than residue.

Limits

This issue is about measured heap growth, not a claimed leak. The measurements are from one suite on one machine, under varying load.

主要言語
JavaScript
スター
5
フォーク
1
平均マージ
8時間 31分
マージ済み PR(30日)
60

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/oracles のほかの issue

TanStack/oracles の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。