Skip to main content

//clika-runtime/io.clika.runtime/MemoryStats

MemoryStats

[common]
data class MemoryStats(val deviceFreeBytes: Long, val deviceTotalBytes: Long, val deviceMemorySource: MemorySource, val activeBytes: Long, val requestedBytes: Long, val reservedBytes: Long, val cachedBytes: Long, val peakActiveBytes: Long, val peakReservedBytes: Long, val peakRequestedBytes: Long, val numAllocs: Long, val numFrees: Long, val numOom: Long, val numInflightParkWaits: Long, val wrappedBytes: Long, val wrappedAllocs: Long)

A device's memory at one point in time (see Device.memoryStats): the physical free and total bytes with how they were obtained, and the runtime pool's counters for that device. requestedBytes is the residency gauge (what the live allocations asked for: a second live copy of a weight doubles it); the peaks only ever rise until Device.resetPeakMemoryStats. Byte counts and tallies are unsigned 64-bit in the runtime and ride Long.

Constructors​

MemoryStats[common]
constructor(deviceFreeBytes: Long, deviceTotalBytes: Long, deviceMemorySource: MemorySource, activeBytes: Long, requestedBytes: Long, reservedBytes: Long, cachedBytes: Long, peakActiveBytes: Long, peakReservedBytes: Long, peakRequestedBytes: Long, numAllocs: Long, numFrees: Long, numOom: Long, numInflightParkWaits: Long, wrappedBytes: Long, wrappedAllocs: Long)

Properties​

NameSummary
activeBytes[common]
val activeBytes: Long
cachedBytes[common]
val cachedBytes: Long
deviceFreeBytes[common]
val deviceFreeBytes: Long
deviceMemorySource[common]
val deviceMemorySource: MemorySource
deviceTotalBytes[common]
val deviceTotalBytes: Long
numAllocs[common]
val numAllocs: Long
numFrees[common]
val numFrees: Long
numInflightParkWaits[common]
val numInflightParkWaits: Long
Allocation requests that waited for an in-flight chunk to retire.
numOom[common]
val numOom: Long
peakActiveBytes[common]
val peakActiveBytes: Long
peakRequestedBytes[common]
val peakRequestedBytes: Long
peakReservedBytes[common]
val peakReservedBytes: Long
requestedBytes[common]
val requestedBytes: Long
reservedBytes[common]
val reservedBytes: Long
wrappedAllocs[common]
val wrappedAllocs: Long
The mappings adopted right now.
wrappedBytes[common]
val wrappedBytes: Long
The adopted subset of activeBytes: memory mapped in place (a model file), released with its mapping.