OptionalendMark: stringReads the browser's JS heap counters at this instant.
⚠️ The only source is the non-standard performance.memory, which Chrome
quantises and then caches for the lifetime of the page unless the browser was
started with --enable-precise-memory-info. Two consequences a caller must know
before trusting the numbers:
scripts/probe-heap-metrics.mjs).performance.memory is absent (every non-Chromium browser), every field
stays 0 — an absent measurement, not an empty heap.A caller that needs a real figure must measure from outside the page (DevTools,
or CDP Runtime.getHeapUsage after HeapProfiler.collectGarbage, which is what
the repository's own heap gate does).
A snapshot whose used/total/available are bytes, or 0 when the
browser exposes no heap counters.
Judges the sampled heap history for abnormal growth.
Samples come from getMemoryUsage while monitoring is running, so the
verdict is only as good as that instrument — and on stock Chrome that instrument
does not move. The method therefore refuses to answer when its own input carries
no information, instead of returning a reassuring "normal".
status is one of:
| value | meaning |
|---|---|
insufficient_data |
fewer than 10 samples collected — start monitoring for longer |
unavailable |
no verdict is computable; see reason |
normal |
the heap moved, and grew by 20 % or less over the window |
warning |
growth above 20 % |
critical |
growth above 50 % |
reason accompanies unavailable only, and is either "heap-api-unavailable"
(the window opens on a zero reading, so no growth rate is defined — the usual
case outside Chromium) or "heap-readings-constant" (every sample in the window
is identical to the byte, which is what Chrome's cached performance.memory
produces — see getMemoryUsage).
⚠️ unavailable is not a failure and it is not normal. It says the browser
gave nothing to judge. Treating it as "no leak" reinstates the defect this
distinction exists to remove: a diagnosis that cannot come out bad closes the
question instead of answering it.
📌 A window that ends where it started is not the same thing: if the readings
varied and simply came back, status is normal with growthRate at 0. The
difference between the two is whether the input moved at all.
The verdict; growthRate, memoryTrend and recommendation are present
only when a growth figure was actually computed.
Collects timing marks and reports them, for diagnosing slow boots and renders.
Reached through getPerformanceProfiler rather than constructed — the marks are only meaningful when they all land on one instance.