Skip to content

Commit b548b76

Browse files
committed
test(gc): heap-return burst must outgrow the shared image's free space
The 8.5 MB burst landed in pages earlier suites had already committed on #80's macOS gate (base 208 MB, grown +0.8 MB), so 'the burst grew the committed heap' failed for reasons unrelated to the page heap. A 34 MB burst with a 16 MB margin measures the page heap again. Suite smoke green in the shared image (847 tests); 3/3 in a fresh process. Card: CLJW-GC-HEAP-TEST-FRAGILE (20261022192250-76e31716). Smell-audited: 1: test fragility fixed at its cause, knowledge 20261022192219-564f7893
1 parent 32fed11 commit b548b76

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎test/clj/suites/gc_heap_return_test.clj‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
(defn- committed [] (.totalMemory (Runtime/getRuntime)))
1212

1313
(defn- burst
14-
"Allocate a ~8.5 MB vector trie (1M elements) and drop it."
14+
"Allocate a ~34 MB vector trie (4M elements) and drop it. It must be much
15+
larger than the free space earlier suites leave in partly used pages of the
16+
shared run_suites image, or it lands in already-committed pages and the
17+
growth is invisible (#80's macOS gate: base 208 MB, burst +0.8 MB)."
1518
[]
16-
(count (vec (range 1000000))))
19+
(count (vec (range 4000000))))
1720

1821
(deftest requested-collect-returns-empty-pages
1922
(System/gc)
@@ -23,9 +26,9 @@
2326
_ (System/gc)
2427
after (committed)]
2528
(testing "the burst grew the committed heap"
26-
(is (> grown (+ base (* 4 mb)))))
29+
(is (> grown (+ base (* 16 mb)))))
2730
(testing "System/gc gave the dropped burst's pages back"
28-
(is (< after (- grown (* 4 mb))))
31+
(is (< after (- grown (* 16 mb))))
2932
(is (<= after (+ base (* 2 mb)))))))
3033

3134
(deftest freed-pages-are-reused-by-the-next-burst

0 commit comments

Comments
 (0)