FA-90498 / Garbage collector invariants / Member archive
Heap pacing: zero percent treated as disabled · case 03
Setting the percentage to 0 stops collections instead of collecting at every goal crossing.
Case contract
GOGC-style pacing starting at 100 percent with goal = min_heap. alloc b adds b to the heap and to live bytes and triggers a collection when collection is enabled (percentage >= 0) and heap >= goal: the heap shrinks to the live bytes, which become the marked size, and goal = max(marked + marked * pct // 100, min_heap). drop b turns b live bytes into garbage. setgc p changes the percentage (-1 disables) and, unless disabled, recomputes the goal from the last marked size. Return the heap sizes at which collections triggered, the final goal and heap.
Why this case matters
Collector pacing decides when collections run; off-by-one or base errors change memory footprint.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| collector disabled then zero percent | {"gcs": [], "goal": 130, "heap": 392} | {"gcs": [391, 392], "goal": 392, "heap": 392} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗