Debug.MemoryInfo  |  API reference  |  Android Developers


public static class Debug.MemoryInfo
extends Object implements Parcelable



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 interface android.os.Parcelable

int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel(Parcel, 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)".

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

MemoryInfo()

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled 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 mapping a file of one of the following extension: .so, .jar, .apk, .ttf, .dex, .odex, .oat, .art .

void readFromParcel(Parcel source)
void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

From interface android.os.Parcelable

abstract int describeContents()

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

abstract void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Fields

dalvikPrivateDirty

public int dalvikPrivateDirty

The private dirty pages used by dalvik heap.

dalvikPss

public int dalvikPss

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

dalvikSharedDirty

public int dalvikSharedDirty

The shared dirty pages used by dalvik heap.

nativePrivateDirty

public int nativePrivateDirty

The private dirty pages used by the native heap.

nativePss

public int nativePss

The proportional set size for the native heap.

nativeSharedDirty

public int nativeSharedDirty

The shared dirty pages used by the native heap.

otherPrivateDirty

public int otherPrivateDirty

The private dirty pages used by everything else.

otherPss

public int otherPss

The proportional set size for everything else.

otherSharedDirty

public int otherSharedDirty

The shared dirty pages used by everything else.

Public constructors

MemoryInfo

public MemoryInfo ()

Public methods

describeContents

public int describeContents ()

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 writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getMemoryStat

public String getMemoryStat (String statName)

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
Parameters
statName String
Returns
String

getTotalPrivateClean

public int getTotalPrivateClean ()

Return total shared clean memory usage in kB.

Returns
int

getTotalPrivateDirty

public int getTotalPrivateDirty ()

Return total private dirty memory usage in kB.

Returns
int

getTotalPss

public int getTotalPss ()

Return total PSS memory usage in kB.

Returns
int

getTotalSharedClean

public int getTotalSharedClean ()

Return total shared clean memory usage in kB.

Returns
int

getTotalSharedDirty

public int getTotalSharedDirty ()

Return total shared dirty memory usage in kB.

Returns
int

getTotalSwappablePss

public int getTotalSwappablePss ()

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

Returns
int

readFromParcel

public void readFromParcel (Parcel source)
Parameters
source Parcel