heap_memory_snapshot_mib

Functionin compute_runtimefastly 0.13.1View source
fn heap_memory_snapshot_mib() -> Result<u32, FastlyStatus>

Get the current dynamic memory usage of this sandbox, rounded up to the nearest mebibyte (2^20 bytes).

The memory accounted includes the WASM linear memory (i.e. heap memory), as well as some memory used by the hosting environment; for instance, HTTP bodies that have been read from a TCP connection, but not read by the WASM program. As such, this function provides only a snapshot in time: the memory usage can change without any action from the WASM program. It can also change across runs, as the Compute platform's memory usage changes. Consider the returned value with these possibilities in mind.

Returns

Result<u32, fastly_shared::FastlyStatus>