One of the five documented size classes.
minimumMemoryInMiB selects a class; it does not size a VM. Both numbers are on the
class or neither.
Accessors
Section titled “Accessors”baselineGb
Section titled “baselineGb”Get Signature
Section titled “Get Signature”get baselineGb(): number;The figure a GB-second rate multiplies. Always the baseline, never the peak.
Returns
Section titled “Returns”number
baselineMib
Section titled “baselineMib”Get Signature
Section titled “Get Signature”get baselineMib(): number;Returns
Section titled “Returns”number
baselineVcpu
Section titled “baselineVcpu”Get Signature
Section titled “Get Signature”get baselineVcpu(): number;Returns
Section titled “Returns”number
peakGb
Section titled “peakGb”Get Signature
Section titled “Get Signature”get peakGb(): number;The peak in GB, which is what the guest reports as MemTotal.
Returns
Section titled “Returns”number
peakMib
Section titled “peakMib”Get Signature
Section titled “Get Signature”get peakMib(): number;Returns
Section titled “Returns”number
peakVcpu
Section titled “peakVcpu”Get Signature
Section titled “Get Signature”get peakVcpu(): number;Returns
Section titled “Returns”number
Methods
Section titled “Methods”describe()
Section titled “describe()”describe(): string;One line naming both numbers.
Returns
Section titled “Returns”string
static all(): SizeClass[];Every class, smallest first.
Returns
Section titled “Returns”SizeClass[]
defaultClass()
Section titled “defaultClass()”static defaultClass(): SizeClass;The platform’s default, 2048 MiB. Not the smallest — a 0.5 GB baseline fixes the guest’s always-present ceiling at 2 GB, which OOM-kills a real test suite, and the guest has no swap.
Returns
Section titled “Returns”SizeClass
fromBaselineMib()
Section titled “fromBaselineMib()”static fromBaselineMib(mib: number): SizeClass;The class minimumMemoryInMiB = mib selects, or a refusal (TRAP-10).
Off-table figures are refused rather than snapped to a neighbour: the two plausible readings differ in both memory and rate, and neither has been measured.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
mib |
number |
Returns
Section titled “Returns”SizeClass
fromRequest()
Section titled “fromRequest()”static fromRequest(cpus?: number | null, memoryMib?: number | null): SizeClass;The smallest class whose baseline covers a resource request (BIND-14).
cpus in vCPUs and memoryMib in MiB, each a request; undefined or zero is no
requirement on that axis, and with none on either the answer is defaultClass().
Chosen by baseline, the billed and always-present figure. Throws ERR_INVALID_ARG
naming the largest class when no class covers the request, or for a CPU figure that is
not a finite non-negative number.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cpus? |
number | null |
memoryMib? |
number | null |
Returns
Section titled “Returns”SizeClass
Provenance
Section titled “Provenance”This page is generated from bindings/microvms-js/index.d.ts by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, run from site/scripts/gen-reference.mjs on every pnpm run sync, so an edit made here is overwritten by the next run.
To change the page, change the doc comment in the binding’s Rust source, then regenerate the declarations with mise run dts. mise run dts:check fails when the committed file no longer matches the source.