com.android.ddmlib
Class NativeAllocationInfo

java.lang.Object
  extended by com.android.ddmlib.NativeAllocationInfo

public final class NativeAllocationInfo
extends java.lang.Object

Stores native allocation information.

Contains number of allocations, their size and the stack trace.

Note: the ddmlib does not resolve the stack trace automatically. While this class provides storage for resolved stack trace, this is merely for convenience.


Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 int getAllocationCount()
          Returns the allocation count.
 NativeStackCallInfo getRelevantStackCallInfo()
          Returns the first NativeStackCallInfo that is relevant.
 NativeStackCallInfo[] getResolvedStackCall()
          Returns the resolved stack call.
 int getSize()
          Returns the total size of this allocation.
 java.lang.Long[] getStackCallAddresses()
          Returns the stack call of this allocation as raw addresses.
 boolean isStackCallResolved()
          Returns whether the stack call addresses have been resolved into NativeStackCallInfo objects.
 boolean isZygoteChild()
          Returns whether the allocation happened in a child of the zygote process.
 void setResolvedStackCall(java.util.List<NativeStackCallInfo> resolvedStackCall)
          Sets the resolved stack call for this allocation.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSize

public int getSize()
Returns the total size of this allocation.


isZygoteChild

public boolean isZygoteChild()
Returns whether the allocation happened in a child of the zygote process.


getAllocationCount

public int getAllocationCount()
Returns the allocation count.


isStackCallResolved

public boolean isStackCallResolved()
Returns whether the stack call addresses have been resolved into NativeStackCallInfo objects.


getStackCallAddresses

public java.lang.Long[] getStackCallAddresses()
Returns the stack call of this allocation as raw addresses.

Returns:
the list of addresses where the allocation happened.

setResolvedStackCall

public void setResolvedStackCall(java.util.List<NativeStackCallInfo> resolvedStackCall)
Sets the resolved stack call for this allocation.

If resolvedStackCall is non null then isStackCallResolved() will return true after this call.

Parameters:
resolvedStackCall - The list of NativeStackCallInfo.

getResolvedStackCall

public NativeStackCallInfo[] getResolvedStackCall()
Returns the resolved stack call.

Returns:
An array of NativeStackCallInfo or null if the stack call was not resolved.
See Also:
#setResolvedStackCall(ArrayList), isStackCallResolved()

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is equal to the obj argument; false otherwise.
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getRelevantStackCallInfo

public NativeStackCallInfo getRelevantStackCallInfo()
Returns the first NativeStackCallInfo that is relevant.

A relevant NativeStackCallInfo is a stack call that is not deep in the lower level of the libc, but the actual method that performed the allocation.

Returns:
a NativeStackCallInfo or null if the stack call has not been processed from the raw addresses.
See Also:
#setResolvedStackCall(ArrayList), isStackCallResolved()


Copyright © 2008-2011. All Rights Reserved.