Package android.os
Class Debug.MemoryInfo
- java.lang.Object
-
- android.os.Debug.MemoryInfo
-
- All Implemented Interfaces:
Parcelable
- Enclosing class:
- Debug
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
-
-
Field Summary
Fields Modifier and Type Field Description static Parcelable.Creator<Debug.MemoryInfo>CREATORintdalvikPrivateCleanintdalvikPrivateDirtyThe private dirty pages used by dalvik heap.intdalvikPssThe proportional set size for dalvik heap.intdalvikSharedCleanintdalvikSharedDirtyThe shared dirty pages used by dalvik heap.intdalvikSwappablePssintdalvikSwappedOutstatic intHEAP_DALVIKstatic intHEAP_NATIVEstatic intHEAP_UNKNOWNintnativePrivateCleanintnativePrivateDirtyThe private dirty pages used by the native heap.intnativePssThe proportional set size for the native heap.intnativeSharedCleanintnativeSharedDirtyThe shared dirty pages used by the native heap.intnativeSwappablePssintnativeSwappedOutstatic intNUM_CATEGORIESstatic intNUM_DVK_STATSstatic intNUM_OTHER_STATSstatic intoffsetPrivateCleanstatic intoffsetPrivateDirtystatic intoffsetPssstatic intoffsetSharedCleanstatic intoffsetSharedDirtystatic intoffsetSwappablePssstatic intoffsetSwappedOutstatic intOTHER_APKstatic intOTHER_ARTstatic intOTHER_ASHMEMstatic intOTHER_CURSORstatic intOTHER_DALVIK_ACCOUNTINGstatic intOTHER_DALVIK_CODE_CACHEstatic intOTHER_DALVIK_INDIRECT_REFERENCE_TABLEstatic intOTHER_DALVIK_LARGEstatic intOTHER_DALVIK_LINEARALLOCstatic intOTHER_DALVIK_NON_MOVINGstatic intOTHER_DALVIK_NORMALstatic intOTHER_DALVIK_OTHERstatic intOTHER_DALVIK_ZYGOTEstatic intOTHER_DEXstatic intOTHER_GLstatic intOTHER_GL_DEVstatic intOTHER_GRAPHICSstatic intOTHER_JARstatic intOTHER_OATstatic intOTHER_OTHER_MEMTRACKstatic intOTHER_SOstatic intOTHER_STACKstatic intOTHER_TTFstatic intOTHER_UNKNOWN_DEVstatic intOTHER_UNKNOWN_MAPintotherPrivateCleanintotherPrivateDirtyThe private dirty pages used by everything else.intotherPssThe proportional set size for everything else.intotherSharedCleanintotherSharedDirtyThe shared dirty pages used by everything else.intotherSwappablePssintotherSwappedOut-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Constructor Description MemoryInfo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()Describe the kinds of special objects contained in this Parcelable's marshalled representation.StringgetMemoryStat(String statName)Returns the value of a particular memory statistic ornullif no such memory statistic exists.Map<String,String>getMemoryStats()Returns a map of the names/values of the memory statistics thatgetMemoryStat(String)supports.static StringgetOtherLabel(int which)intgetOtherPrivate(int which)intgetOtherPrivateClean(int which)intgetOtherPrivateDirty(int which)intgetOtherPss(int which)intgetOtherSharedClean(int which)intgetOtherSharedDirty(int which)intgetOtherSwappablePss(int which)intgetOtherSwappedOut(int which)intgetSummaryCode()Pss of code and other static resource bytes in KB due to the application.intgetSummaryGraphics()Pss in KB of graphics due to the application.intgetSummaryJavaHeap()Pss of Java Heap bytes in KB due to the application.intgetSummaryNativeHeap()Pss of Native Heap bytes in KB due to the application.intgetSummaryPrivateOther()Pss in KB due to the application that haven't otherwise been accounted for.intgetSummaryStack()Pss in KB of the stack due to the application.intgetSummarySystem()Pss in KB due to the system.intgetSummaryTotalPss()Total Pss in KB.intgetSummaryTotalSwap()Total Swap in KB.intgetTotalPrivateClean()Return total shared clean memory usage in kB.intgetTotalPrivateDirty()Return total private dirty memory usage in kB.intgetTotalPss()Return total PSS memory usage in kB.intgetTotalSharedClean()Return total shared clean memory usage in kB.intgetTotalSharedDirty()Return total shared dirty memory usage in kB.intgetTotalSwappablePss()Return total PSS memory usage in kB.intgetTotalSwappedOut()Return total swapped out memory in kB.intgetTotalUss()voidreadFromParcel(Parcel source)voidwriteToParcel(Parcel dest, int flags)Flatten this object in to a Parcel.
-
-
-
Field Detail
-
dalvikPss
public int dalvikPss
The proportional set size for dalvik heap. (Doesn't include other Dalvik overhead.)
-
dalvikSwappablePss
public int dalvikSwappablePss
-
dalvikPrivateDirty
public int dalvikPrivateDirty
The private dirty pages used by dalvik heap.
-
dalvikSharedDirty
public int dalvikSharedDirty
The shared dirty pages used by dalvik heap.
-
dalvikPrivateClean
public int dalvikPrivateClean
-
dalvikSharedClean
public int dalvikSharedClean
-
dalvikSwappedOut
public int dalvikSwappedOut
-
nativePss
public int nativePss
The proportional set size for the native heap.
-
nativeSwappablePss
public int nativeSwappablePss
-
nativePrivateDirty
public int nativePrivateDirty
The private dirty pages used by the native heap.
-
nativeSharedDirty
public int nativeSharedDirty
The shared dirty pages used by the native heap.
-
nativePrivateClean
public int nativePrivateClean
-
nativeSharedClean
public int nativeSharedClean
-
nativeSwappedOut
public int nativeSwappedOut
-
otherPss
public int otherPss
The proportional set size for everything else.
-
otherSwappablePss
public int otherSwappablePss
-
otherPrivateDirty
public int otherPrivateDirty
The private dirty pages used by everything else.
-
otherSharedDirty
public int otherSharedDirty
The shared dirty pages used by everything else.
-
otherPrivateClean
public int otherPrivateClean
-
otherSharedClean
public int otherSharedClean
-
otherSwappedOut
public int otherSwappedOut
-
HEAP_UNKNOWN
public static final int HEAP_UNKNOWN
- See Also:
- Constant Field Values
-
HEAP_DALVIK
public static final int HEAP_DALVIK
- See Also:
- Constant Field Values
-
HEAP_NATIVE
public static final int HEAP_NATIVE
- See Also:
- Constant Field Values
-
OTHER_DALVIK_OTHER
public static final int OTHER_DALVIK_OTHER
- See Also:
- Constant Field Values
-
OTHER_STACK
public static final int OTHER_STACK
- See Also:
- Constant Field Values
-
OTHER_CURSOR
public static final int OTHER_CURSOR
- See Also:
- Constant Field Values
-
OTHER_ASHMEM
public static final int OTHER_ASHMEM
- See Also:
- Constant Field Values
-
OTHER_GL_DEV
public static final int OTHER_GL_DEV
- See Also:
- Constant Field Values
-
OTHER_UNKNOWN_DEV
public static final int OTHER_UNKNOWN_DEV
- See Also:
- Constant Field Values
-
OTHER_SO
public static final int OTHER_SO
- See Also:
- Constant Field Values
-
OTHER_JAR
public static final int OTHER_JAR
- See Also:
- Constant Field Values
-
OTHER_APK
public static final int OTHER_APK
- See Also:
- Constant Field Values
-
OTHER_TTF
public static final int OTHER_TTF
- See Also:
- Constant Field Values
-
OTHER_DEX
public static final int OTHER_DEX
- See Also:
- Constant Field Values
-
OTHER_OAT
public static final int OTHER_OAT
- See Also:
- Constant Field Values
-
OTHER_ART
public static final int OTHER_ART
- See Also:
- Constant Field Values
-
OTHER_UNKNOWN_MAP
public static final int OTHER_UNKNOWN_MAP
- See Also:
- Constant Field Values
-
OTHER_GRAPHICS
public static final int OTHER_GRAPHICS
- See Also:
- Constant Field Values
-
OTHER_GL
public static final int OTHER_GL
- See Also:
- Constant Field Values
-
OTHER_OTHER_MEMTRACK
public static final int OTHER_OTHER_MEMTRACK
- See Also:
- Constant Field Values
-
OTHER_DALVIK_NORMAL
public static final int OTHER_DALVIK_NORMAL
- See Also:
- Constant Field Values
-
OTHER_DALVIK_LARGE
public static final int OTHER_DALVIK_LARGE
- See Also:
- Constant Field Values
-
OTHER_DALVIK_LINEARALLOC
public static final int OTHER_DALVIK_LINEARALLOC
- See Also:
- Constant Field Values
-
OTHER_DALVIK_ACCOUNTING
public static final int OTHER_DALVIK_ACCOUNTING
- See Also:
- Constant Field Values
-
OTHER_DALVIK_CODE_CACHE
public static final int OTHER_DALVIK_CODE_CACHE
- See Also:
- Constant Field Values
-
OTHER_DALVIK_ZYGOTE
public static final int OTHER_DALVIK_ZYGOTE
- See Also:
- Constant Field Values
-
OTHER_DALVIK_NON_MOVING
public static final int OTHER_DALVIK_NON_MOVING
- See Also:
- Constant Field Values
-
OTHER_DALVIK_INDIRECT_REFERENCE_TABLE
public static final int OTHER_DALVIK_INDIRECT_REFERENCE_TABLE
- See Also:
- Constant Field Values
-
NUM_OTHER_STATS
public static final int NUM_OTHER_STATS
- See Also:
- Constant Field Values
-
NUM_DVK_STATS
public static final int NUM_DVK_STATS
- See Also:
- Constant Field Values
-
NUM_CATEGORIES
public static final int NUM_CATEGORIES
- See Also:
- Constant Field Values
-
offsetPss
public static final int offsetPss
- See Also:
- Constant Field Values
-
offsetSwappablePss
public static final int offsetSwappablePss
- See Also:
- Constant Field Values
-
offsetPrivateDirty
public static final int offsetPrivateDirty
- See Also:
- Constant Field Values
-
offsetSharedDirty
public static final int offsetSharedDirty
- See Also:
- Constant Field Values
-
offsetPrivateClean
public static final int offsetPrivateClean
- See Also:
- Constant Field Values
-
offsetSharedClean
public static final int offsetSharedClean
- See Also:
- Constant Field Values
-
offsetSwappedOut
public static final int offsetSwappedOut
- See Also:
- Constant Field Values
-
CREATOR
public static final Parcelable.Creator<Debug.MemoryInfo> CREATOR
-
-
Method Detail
-
getTotalPss
public int getTotalPss()
Return total PSS memory usage in kB.
-
getTotalUss
public int getTotalUss()
-
getTotalSwappablePss
public int getTotalSwappablePss()
Return total PSS memory usage in kB.
-
getTotalPrivateDirty
public int getTotalPrivateDirty()
Return total private dirty memory usage in kB.
-
getTotalSharedDirty
public int getTotalSharedDirty()
Return total shared dirty memory usage in kB.
-
getTotalPrivateClean
public int getTotalPrivateClean()
Return total shared clean memory usage in kB.
-
getTotalSharedClean
public int getTotalSharedClean()
Return total shared clean memory usage in kB.
-
getTotalSwappedOut
public int getTotalSwappedOut()
Return total swapped out memory in kB.
-
getOtherPss
public int getOtherPss(int which)
-
getOtherSwappablePss
public int getOtherSwappablePss(int which)
-
getOtherPrivateDirty
public int getOtherPrivateDirty(int which)
-
getOtherSharedDirty
public int getOtherSharedDirty(int which)
-
getOtherPrivateClean
public int getOtherPrivateClean(int which)
-
getOtherPrivate
public int getOtherPrivate(int which)
-
getOtherSharedClean
public int getOtherSharedClean(int which)
-
getOtherSwappedOut
public int getOtherSwappedOut(int which)
-
getOtherLabel
public static String getOtherLabel(int which)
-
getMemoryStat
public String getMemoryStat(String statName)
Returns the value of a particular memory statistic ornullif 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. 144223 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. 144223 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. 144223 summary.stack The stack usage in kB. This corresponds to the Stack field in the App Summary section output by dumpsys meminfo. 144223 summary.graphics The graphics usage in kB. This corresponds to the Graphics field in the App Summary section output by dumpsys meminfo. 144223 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. 144223 summary.system Shared and system memory usage in kB. This corresponds to the System field output in the App Summary section by dumpsys meminfo. 144223 summary.total-pss Total PPS memory usage in kB. 144223 summary.total-swap Total swap usage in kB. 144223
-
getMemoryStats
public Map<String,String> getMemoryStats()
Returns a map of the names/values of the memory statistics thatgetMemoryStat(String)supports.- Returns:
- a map of the names/values of the supported memory statistics.
-
getSummaryJavaHeap
public int getSummaryJavaHeap()
Pss of Java Heap bytes in KB due to the application. Notes: * OTHER_ART is the boot image. Anything private here is blamed on the application, not the system. * dalvikPrivateDirty includes private zygote, which means the application dirtied something allocated by the zygote. We blame the application for that memory, not the system. * Does not include OTHER_DALVIK_OTHER, which is considered VM Overhead and lumped into Private Other. * We don't include dalvikPrivateClean, because there should be no such thing as private clean for the Java Heap.
-
getSummaryNativeHeap
public int getSummaryNativeHeap()
Pss of Native Heap bytes in KB due to the application. Notes: * Includes private dirty malloc space. * We don't include nativePrivateClean, because there should be no such thing as private clean for the Native Heap.
-
getSummaryCode
public int getSummaryCode()
Pss of code and other static resource bytes in KB due to the application.
-
getSummaryStack
public int getSummaryStack()
Pss in KB of the stack due to the application. Notes: * Includes private dirty stack, which includes both Java and Native stack. * Does not include private clean stack, because there should be no such thing as private clean for the stack.
-
getSummaryGraphics
public int getSummaryGraphics()
Pss in KB of graphics due to the application. Notes: * Includes private Gfx, EGL, and GL. * Warning: These numbers can be misreported by the graphics drivers. * We don't include shared graphics. It may make sense to, because shared graphics are likely buffers due to the application anyway, but it's simpler to implement to just group all shared memory into the System category.
-
getSummaryPrivateOther
public int getSummaryPrivateOther()
Pss in KB due to the application that haven't otherwise been accounted for.
-
getSummarySystem
public int getSummarySystem()
Pss in KB due to the system. Notes: * Includes all shared memory.
-
getSummaryTotalPss
public int getSummaryTotalPss()
Total Pss in KB.
-
getSummaryTotalSwap
public int getSummaryTotalSwap()
Total Swap in KB. Notes: * Some of this memory belongs in other categories, but we don't know if the Swap memory is shared or private, so we don't know what to blame on the application and what on the system. For now, just lump all the Swap in one place.
-
describeContents
public int describeContents()
Description copied from interface:ParcelableDescribe the kinds of special objects contained in this Parcelable's marshalled representation.- Specified by:
describeContentsin interfaceParcelable- Returns:
- a bitmask indicating the set of special object types marshalled by the Parcelable.
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
Description copied from interface:ParcelableFlatten this object in to a Parcel.- Specified by:
writeToParcelin interfaceParcelable- Parameters:
dest- The Parcel in which the object should be written.flags- Additional flags about how the object should be written. May be 0 orParcelable.PARCELABLE_WRITE_RETURN_VALUE.
-
readFromParcel
public void readFromParcel(Parcel source)
-
-