# MemoryUsageMetric.SubMetric

Artifact: [androidx.benchmark:benchmark-macro](https://developer.android.com/jetpack/androidx/releases/benchmark) [View Source](https://cs.android.com/search?q=file:androidx/benchmark/macro/Metric.kt+class:androidx.benchmark.macro.MemoryUsageMetric.SubMetric) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.2.0)

*** ** * ** ***


```
enum MemoryUsageMetric.SubMetric : Enum<MemoryUsageMetric.SubMetric>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[MemoryUsageMetric.SubMetric](https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric)\> ||
|   | ↳ | [androidx.benchmark.macro.MemoryUsageMetric.SubMetric](https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric) |

*** ** * ** ***

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#BitmapMemory` | Tracks the amount of Bitmap memory allocated for the process. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#Gpu` | Measures the amount of GPU-specific memory allocated for the process. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#HeapSize` | Tracks the total size of the Android Runtime (ART) heap. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#RssAnon` | Tracks anonymous resident set size memory. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#RssFile` | Tracks memory used to map files from disk into the process's address space. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#RssShmem` | Tracks shared memory resident in the process. |
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#Swap` | Tracks memory that has been swapped out to disk or compressed in zRAM. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric>` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric>` | `https://developer.android.com/reference/kotlin/androidx/benchmark/macro/MemoryUsageMetric.SubMetric#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. |

## Enum Values

### BitmapMemory

```
val MemoryUsageMetric.SubMetric.BitmapMemory: MemoryUsageMetric.SubMetric
```

Tracks the amount of Bitmap memory allocated for the process.

Requires API 36+.

### Gpu

```
val MemoryUsageMetric.SubMetric.Gpu: MemoryUsageMetric.SubMetric
```

Measures the amount of GPU-specific memory allocated for the process. This is particularly useful for identifying high memory usage related to textures, shaders, or other graphics-heavy components.

### HeapSize

```
val MemoryUsageMetric.SubMetric.HeapSize: MemoryUsageMetric.SubMetric
```

Tracks the total size of the Android Runtime (ART) heap. These samples are typically captured immediately after a Garbage Collection (GC) event, providing a look at the "live" set of objects in the application's managed memory.

### RssAnon

```
val MemoryUsageMetric.SubMetric.RssAnon: MemoryUsageMetric.SubMetric
```

Tracks anonymous resident set size memory. This represents memory allocated directly by the process---such as via malloc or mmap---that is not backed by any file on disk. It is often the primary indicator of the app's dynamic memory consumption.

### RssFile

```
val MemoryUsageMetric.SubMetric.RssFile: MemoryUsageMetric.SubMetric
```

Tracks memory used to map files from disk into the process's address space. This includes shared libraries, dex files, and other resource assets loaded by the application.

### RssShmem

```
val MemoryUsageMetric.SubMetric.RssShmem: MemoryUsageMetric.SubMetric
```

Tracks shared memory resident in the process. This includes memory shared between processes, such as shared buffers or specialized memory regions.

### Swap

```
val MemoryUsageMetric.SubMetric.Swap: MemoryUsageMetric.SubMetric
```

Tracks memory that has been swapped out to disk or compressed in zRAM. This represents memory that is currently not in physical RAM but is still allocated by the process.

Requires API 33+.

## Public functions

### valueOf

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.2.0)

```
fun valueOf(value: String): MemoryUsageMetric.SubMetric
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/benchmark#1.2.0)

```
fun values(): Array<MemoryUsageMetric.SubMetric>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

```
val entries: EnumEntries<MemoryUsageMetric.SubMetric>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.