Android APIs
public static class

Debug.MemoryInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.os.Debug.MemoryInfo

Class Overview

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

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<Debug.MemoryInfo> CREATOR
public int dalvikPrivateDirty The private dirty pages used by dalvik heap.
public int dalvikPss The proportional set size for dalvik heap.
public int dalvikSharedDirty The shared dirty pages used by dalvik heap.
public int nativePrivateDirty The private dirty pages used by the native heap.
public int nativePss The proportional set size for the native heap.
public int nativeSharedDirty The shared dirty pages used by the native heap.
public int otherPrivateDirty The private dirty pages used by everything else.
public int otherPss The proportional set size for everything else.
public int otherSharedDirty The shared dirty pages used by everything else.
Public Constructors
Debug.MemoryInfo()
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
String getMemoryStat(String statName)
Returns the value of a particular memory statistic or null if no such memory statistic exists.
Map<StringString> getMemoryStats()
Returns a map of the names/values of the memory statistics that getMemoryStat(String) supports.
int getTotalPrivateClean()
Return total shared clean memory usage in kB.
int getTotalPrivateDirty()
Return total private dirty memory usage in kB.
int getTotalPss()
Return total PSS memory usage in kB.
int getTotalSharedClean()
Return total shared clean memory usage in kB.
int getTotalSharedDirty()
Return total shared dirty memory usage in kB.
int getTotalSwappablePss()
Return total PSS memory usage in kB.
void readFromParcel(Parcel source)
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<Debug.MemoryInfo> CREATOR

Added in API level 5

public int dalvikPrivateDirty

Added in API level 1

The private dirty pages used by dalvik heap.

public int dalvikPss

Added in API level 1

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

public int dalvikSharedDirty

Added in API level 1

The shared dirty pages used by dalvik heap.

public int nativePrivateDirty

Added in API level 1

The private dirty pages used by the native heap.

public int nativePss

Added in API level 1

The proportional set size for the native heap.

public int nativeSharedDirty

Added in API level 1

The shared dirty pages used by the native heap.

public int otherPrivateDirty

Added in API level 1

The private dirty pages used by everything else.

public int otherPss

Added in API level 1

The proportional set size for everything else.

public int otherSharedDirty

Added in API level 1

The shared dirty pages used by everything else.

Public Constructors

public Debug.MemoryInfo ()

Added in API level 1

Public Methods

public int describeContents ()

Added in API level 5

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
int a bitmask indicating the set of special object types marshalled by the Parcelable.

public String getMemoryStat (String statName)

Added in API level 23

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 PPS memory usage in kB. 1442 23
summary.total-swap Total swap usage in kB. 1442 23

Parameters
statName String
Returns
String

public Map<StringString> getMemoryStats ()

Added in API level 23

Returns a map of the names/values of the memory statistics that getMemoryStat(String) supports.

Returns
Map<StringString> a map of the names/values of the supported memory statistics.

public int getTotalPrivateClean ()

Added in API level 19

Return total shared clean memory usage in kB.

Returns
int

public int getTotalPrivateDirty ()

Added in API level 5

Return total private dirty memory usage in kB.

Returns
int

public int getTotalPss ()

Added in API level 5

Return total PSS memory usage in kB.

Returns
int

public int getTotalSharedClean ()

Added in API level 19

Return total shared clean memory usage in kB.

Returns
int

public int getTotalSharedDirty ()

Added in API level 5

Return total shared dirty memory usage in kB.

Returns
int

public int getTotalSwappablePss ()

Added in API level 19

Return total PSS memory usage in kB.

Returns
int

public void readFromParcel (Parcel source)

Added in API level 5

Parameters
source Parcel

public void writeToParcel (Parcel dest, int flags)

Added in API level 5

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.