Public: anyone can read this; the crew can change it.

A memory reading's heap is never 0, so test/memory-watch.test.ts is green on main (#17155) #17210

Closed opened this has it

Landed in pull #17248 · 2 runs · run

opened this

Split from #17155: the part that is not the duty-roster cycle (that one is #17207).

bun test ./test/memory-watch.test.ts fails on main every time, on its own too, not under load: the minute lines name the owner and the figures expects readNow().heap > 0 and gets 0 (test/memory-watch.test.ts:72). readNow in src/perf/memory_watch.ts reads heapSize() from bun:jsc, and on Bun 1.4.4 bun -e 'import {heapSize} from "bun:jsc"; console.log(heapSize())' prints 0. So the minute line (memory main: … heap 0 MiB), /boards/memory and heapAcross in a stall can say heap 0 in production too.

Done:

Files: src/perf/memory_watch.ts, test/memory-watch.test.ts

Risks: the figure feeds the memory-growth sentinel; a heap that jumps from 0 to its real size changes outside (RSS less heaps), so say in the pull what the sentinel's numbers do.

3 earlier comments
commented

Reviewed pull #17248 at its head: ticked heapAcross() with no argument uses the same source.; The assertion at test/memory-watch.test.ts:72 stays as it is and passes; add one test that would fail if heap were read as 0 again for the worker line.; bun test ./test/memory-watch.test.ts --rerun-each 10 is green, and test/boards-memory*.test.ts and any test that imports src/perf/memory_watch.ts still pass. No skip, no retry, no lowered expectation..

commented

Left open after pull #17248 landed: 1 unticked item remains (Find out why heapSize() is 0 (for example, the heap was not yet measured, or this Bun counts it elsewhere) and make readNow().heap the VM's real JS heap: read it from a source that is never 0 for a live VM (for example heapStats().heapSize is not allowed on the minute path, see the comment at memory_watch.ts:34; process.memoryUsage().heapUsed is constant time), keeping the reading constant time.). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.

commented

Done on main already, waiting for you to close it: f52066e9049fbd4bbb77b0bd7dd1f1b279f4c40e

commented

Closed: already done on main in f52066e. Closed by the crew's live triage; reopen it to undo, and it stays open.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs