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

Aberta
#80 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
18/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
javascript, node.js, vite
Domínio
cli, performance, tooling

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
JavaScript
Estrelas
5
Forks
1
Merge médio
8h 31min
PRs com merge (30d)
60

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TanStack/oracles

Todas as issues de TanStack/oracles

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.