Class: MemoryPressureMonitor
Samples the renderer's heap and tells its owner when to shed load.
This is the backstop under every individual queue cap: a bounded queue
only protects against the growth path someone thought to bound, while a
heap watchdog notices the ones nobody found. Sampling is pure and
time-injected (MemoryPressureMonitor.sample) so the state machine
is testable without timers, and a missing performance.memory degrades to
a permanently steady monitor rather than a throw.
Constructors
constructor
• new MemoryPressureMonitor(options?, readHeap?): MemoryPressureMonitor
Parameters
| Name | Type | Default value |
|---|---|---|
options | Partial<MemoryPressureOptions> | {} |
readHeap | HeapReader | readChromiumHeap |
Returns
Properties
options
• Readonly options: MemoryPressureOptions
Methods
getStatus
▸ getStatus(): MemoryPressureStatus
Returns
sample
▸ sample(nowMs): MemoryPressureVerdict
Parameters
| Name | Type |
|---|---|
nowMs | number |
Returns
start
▸ start(onVerdict): void
Parameters
| Name | Type |
|---|---|
onVerdict | (verdict: "shed" | "relieved", status: MemoryPressureStatus) => void |
Returns
void
stop
▸ stop(): void
Returns
void