---
title: "MemoryStats"
sidebar_label: "MemoryStats"
description: "Kotlin binding reference: MemoryStats."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[MemoryStats](index.md)

# MemoryStats

[common]\
data class [MemoryStats](index.md)(val deviceFreeBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val deviceTotalBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val deviceMemorySource: [MemorySource](../MemorySource/index.md), val activeBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val requestedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val reservedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val cachedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val peakActiveBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val peakReservedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val peakRequestedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val numAllocs: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val numFrees: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val numOom: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val numInflightParkWaits: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val wrappedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val wrappedAllocs: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html))

A device's memory at one point in time (see [Device.memoryStats](../Device/memoryStats.md)): the physical free and total bytes with how they were obtained, and the runtime pool's counters for that device. [requestedBytes](requestedBytes.md) 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](../Device/resetPeakMemoryStats.md). Byte counts and tallies are unsigned 64-bit in the runtime and ride `Long`.

## Constructors

| | |
|---|---|
| [MemoryStats](MemoryStats.md) | [common]<br>constructor(deviceFreeBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), deviceTotalBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), deviceMemorySource: [MemorySource](../MemorySource/index.md), activeBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), requestedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), reservedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), cachedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), peakActiveBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), peakReservedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), peakRequestedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), numAllocs: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), numFrees: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), numOom: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), numInflightParkWaits: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), wrappedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), wrappedAllocs: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)) |

## Properties

| Name | Summary |
|---|---|
| [activeBytes](activeBytes.md) | [common]<br>val [activeBytes](activeBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [cachedBytes](cachedBytes.md) | [common]<br>val [cachedBytes](cachedBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [deviceFreeBytes](deviceFreeBytes.md) | [common]<br>val [deviceFreeBytes](deviceFreeBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [deviceMemorySource](deviceMemorySource.md) | [common]<br>val [deviceMemorySource](deviceMemorySource.md): [MemorySource](../MemorySource/index.md) |
| [deviceTotalBytes](deviceTotalBytes.md) | [common]<br>val [deviceTotalBytes](deviceTotalBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [numAllocs](numAllocs.md) | [common]<br>val [numAllocs](numAllocs.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [numFrees](numFrees.md) | [common]<br>val [numFrees](numFrees.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [numInflightParkWaits](numInflightParkWaits.md) | [common]<br>val [numInflightParkWaits](numInflightParkWaits.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)<br>Allocation requests that waited for an in-flight chunk to retire. |
| [numOom](numOom.md) | [common]<br>val [numOom](numOom.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [peakActiveBytes](peakActiveBytes.md) | [common]<br>val [peakActiveBytes](peakActiveBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [peakRequestedBytes](peakRequestedBytes.md) | [common]<br>val [peakRequestedBytes](peakRequestedBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [peakReservedBytes](peakReservedBytes.md) | [common]<br>val [peakReservedBytes](peakReservedBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [requestedBytes](requestedBytes.md) | [common]<br>val [requestedBytes](requestedBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [reservedBytes](reservedBytes.md) | [common]<br>val [reservedBytes](reservedBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [wrappedAllocs](wrappedAllocs.md) | [common]<br>val [wrappedAllocs](wrappedAllocs.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)<br>The mappings adopted right now. |
| [wrappedBytes](wrappedBytes.md) | [common]<br>val [wrappedBytes](wrappedBytes.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)<br>The adopted subset of [activeBytes](activeBytes.md): memory mapped in place (a model file), released with its mapping. |