Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# MemoryInfo

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/os/Debug.MemoryInfo "View this page in Java")

```
class MemoryInfo : Parcelable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.os.Debug.MemoryInfo](https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#) |

This class is used to retrieved various statistics about the memory mappings for this process. The returned info is broken down by dalvik, native, and other. All results are in kB.

## Summary

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/os/Parcelable` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` Descriptor bit used with `https://developer.android.com/reference/kotlin/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` Flag for use with `https://developer.android.com/reference/kotlin/android/os/Parcelable#writeToParcel(android.os.Parcel,%20kotlin.Int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#MemoryInfo()()` <br /> |

| Public methods ||
|---|---|
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#describeContents()()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getMemoryStat(kotlin.String)(statName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!)` Returns the value of a particular memory statistic or `null` if no such memory statistic exists. |
| open [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!, [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>! | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getMemoryStats()()` Returns a map of the names/values of the memory statistics that `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getMemoryStat(kotlin.String)` supports. |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getTotalPrivateClean()()` Return total shared clean memory usage in kB. |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getTotalPrivateDirty()()` Return total private dirty memory usage in kB. |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getTotalPss()()` Return total PSS memory usage in kB. |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getTotalSharedClean()()` Return total shared clean memory usage in kB. |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getTotalSharedDirty()()` Return total shared dirty memory usage in kB. |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getTotalSwappablePss()()` Return total PSS memory usage in kB mapping a file of one of the following extension: . |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#readFromParcel(android.os.Parcel)(source: https://developer.android.com/reference/kotlin/android/os/Parcel!)` <br /> |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#writeToParcel(android.os.Parcel,%20kotlin.Int)(dest: https://developer.android.com/reference/kotlin/android/os/Parcel, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Flatten this object in to a Parcel. |

| Properties ||
|---|---|
| static [Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator)\<[Debug.MemoryInfo](https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#)!\> | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#CREATOR:android.os.Parcelable.Creator` <br /> |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#dalvikPrivateDirty:kotlin.Int` The private dirty pages used by dalvik heap. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#dalvikPss:kotlin.Int` The proportional set size for dalvik heap. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#dalvikSharedDirty:kotlin.Int` The shared dirty pages used by dalvik heap. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#nativePrivateDirty:kotlin.Int` The private dirty pages used by the native heap. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#nativePss:kotlin.Int` The proportional set size for the native heap. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#nativeSharedDirty:kotlin.Int` The shared dirty pages used by the native heap. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#otherPrivateDirty:kotlin.Int` The private dirty pages used by everything else. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#otherPss:kotlin.Int` The proportional set size for everything else. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#otherSharedDirty:kotlin.Int` The shared dirty pages used by everything else. |

## Public constructors

### MemoryInfo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
MemoryInfo()
```

## Public methods

### describeContents

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun describeContents(): Int
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/kotlin/android/os/Parcelable#writeToParcel(android.os.Parcel,%20kotlin.Int)`, the return value of this method must include the `https://developer.android.com/reference/kotlin/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` bit.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/kotlin/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` |

### getMemoryStat

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getMemoryStat(statName: String!): String!
```

Returns the value of a particular memory statistic or `null` if no such memory statistic exists.

The following table lists the memory statistics that are supported. Note that memory statistics may be added or removed in a future API level.

| Memory statistic name | Meaning | Example | Supported (API Levels) |
|---|---|---|---|
| summary.java-heap | The private Java Heap usage in kB. This corresponds to the Java Heap field in the App Summary section output by dumpsys meminfo. | `1442` | 23 |
| summary.native-heap | The private Native Heap usage in kB. This corresponds to the Native Heap field in the App Summary section output by dumpsys meminfo. | `1442` | 23 |
| summary.code | The memory usage for static code and resources in kB. This corresponds to the Code field in the App Summary section output by dumpsys meminfo. | `1442` | 23 |
| summary.stack | The stack usage in kB. This corresponds to the Stack field in the App Summary section output by dumpsys meminfo. | `1442` | 23 |
| summary.graphics | The graphics usage in kB. This corresponds to the Graphics field in the App Summary section output by dumpsys meminfo. | `1442` | 23 |
| summary.private-other | Other private memory usage in kB. This corresponds to the Private Other field output in the App Summary section by dumpsys meminfo. | `1442` | 23 |
| summary.system | Shared and system memory usage in kB. This corresponds to the System field output in the App Summary section by dumpsys meminfo. | `1442` | 23 |
| summary.total-pss | Total PSS memory usage in kB. | `1442` | 23 |
| summary.total-swap | Total swap usage in kB. | `1442` | 23 |

### getMemoryStats

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getMemoryStats(): MutableMap<String!, String!>!
```

Returns a map of the names/values of the memory statistics that `https://developer.android.com/reference/kotlin/android/os/Debug.MemoryInfo#getMemoryStat(kotlin.String)` supports.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!>!` | a map of the names/values of the supported memory statistics. |

### getTotalPrivateClean

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getTotalPrivateClean(): Int
```

Return total shared clean memory usage in kB.

### getTotalPrivateDirty

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getTotalPrivateDirty(): Int
```

Return total private dirty memory usage in kB.

### getTotalPss

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getTotalPss(): Int
```

Return total PSS memory usage in kB.

### getTotalSharedClean

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getTotalSharedClean(): Int
```

Return total shared clean memory usage in kB.

### getTotalSharedDirty

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getTotalSharedDirty(): Int
```

Return total shared dirty memory usage in kB.

### getTotalSwappablePss

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getTotalSwappablePss(): Int
```

Return total PSS memory usage in kB mapping a file of one of the following extension: .so, .jar, .apk, .ttf, .dex, .odex, .oat, .art .

### readFromParcel

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun readFromParcel(source: Parcel!): Unit
```

### writeToParcel

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Flatten this object in to a Parcel.

| Parameters ||
|---|---|
| `dest` | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel): The Parcel in which the object should be written. This value cannot be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/kotlin/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` |

## Properties

### CREATOR

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val CREATOR: Parcelable.Creator<Debug.MemoryInfo!>
```

### dalvikPrivateDirty

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var dalvikPrivateDirty: Int
```

The private dirty pages used by dalvik heap.

### dalvikPss

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var dalvikPss: Int
```

The proportional set size for dalvik heap. (Doesn't include other Dalvik overhead.)

### dalvikSharedDirty

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var dalvikSharedDirty: Int
```

The shared dirty pages used by dalvik heap.

### nativePrivateDirty

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var nativePrivateDirty: Int
```

The private dirty pages used by the native heap.

### nativePss

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var nativePss: Int
```

The proportional set size for the native heap.

### nativeSharedDirty

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var nativeSharedDirty: Int
```

The shared dirty pages used by the native heap.

### otherPrivateDirty

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var otherPrivateDirty: Int
```

The private dirty pages used by everything else.

### otherPss

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var otherPss: Int
```

The proportional set size for everything else.

### otherSharedDirty

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
var otherSharedDirty: Int
```

The shared dirty pages used by everything else.