Fields Summary |
---|
private static final String | PRE_INITIALIZEDTemporary name of VM to be ignored. |
public static final int | DEBUGGER_DEFAULTDebugger connection status: not waiting on one, not connected to one, but accepting
new connections. This is the default value. |
public static final int | DEBUGGER_WAITINGDebugger connection status: the application's VM is paused, waiting for a debugger to
connect to it before resuming. |
public static final int | DEBUGGER_ATTACHEDDebugger connection status : Debugger is connected |
public static final int | DEBUGGER_ERRORDebugger connection status: The listening port for debugger connection failed to listen.
No debugger will be able to connect. |
public static final int | ALLOCATION_TRACKING_UNKNOWNAllocation tracking status: unknown.
This happens right after a {@link Client} is discovered
by the {@link AndroidDebugBridge}, and before the {@link Client} answered the query regarding
its allocation tracking status. |
public static final int | ALLOCATION_TRACKING_OFFAllocation tracking status: the {@link Client} is not tracking allocations. |
public static final int | ALLOCATION_TRACKING_ONAllocation tracking status: the {@link Client} is tracking allocations. |
public static final String | HEAP_MAX_SIZE_BYTESName of the value representing the max size of the heap, in the {@link Map} returned by
{@link #getVmHeapInfo(int)} |
public static final String | HEAP_SIZE_BYTESName of the value representing the size of the heap, in the {@link Map} returned by
{@link #getVmHeapInfo(int)} |
public static final String | HEAP_BYTES_ALLOCATEDName of the value representing the number of allocated bytes of the heap, in the
{@link Map} returned by {@link #getVmHeapInfo(int)} |
public static final String | HEAP_OBJECTS_ALLOCATEDName of the value representing the number of objects in the heap, in the {@link Map}
returned by {@link #getVmHeapInfo(int)} |
private boolean | mIsDdmAware |
private final int | mPid |
private String | mVmIdentifier |
private String | mClientDescription |
private int | mDebuggerInterest |
private TreeMap | mThreadMap |
private final HeapData | mHeapDataVM Heap data |
private final HeapData | mNativeHeapDataNative Heap data |
private HashMap | mHeapInfoMap |
private ArrayList | mNativeLibMapInfolibrary map info. Stored here since the backtrace data
is computed on a need to display basis. |
private ArrayList | mNativeAllocationListNative Alloc info list |
private int | mNativeTotalMemory |
private AllocationInfo[] | mAllocations |
private int | mAllocationStatus |
Methods Summary |
---|
synchronized void | addNativeAllocation(NativeAllocationInfo allocInfo)adds a new {@link NativeAllocationInfo} to the {@link Client}
mNativeAllocationList.add(allocInfo);
|
synchronized void | addNativeLibraryMapInfo(long startAddr, long endAddr, java.lang.String library)
mNativeLibMapInfo.add(new NativeLibraryMapInfo(startAddr, endAddr, library));
|
synchronized void | addThread(int threadId, java.lang.String threadName)Adds a new thread to the list.
ThreadInfo attr = new ThreadInfo(threadId, threadName);
mThreadMap.put(threadId, attr);
|
synchronized void | clearNativeAllocationInfo()Clear the current malloc info.
mNativeAllocationList.clear();
|
synchronized void | clearThreads()
mThreadMap.clear();
|
public synchronized int | getAllocationStatus()Returns the allocation tracking status.
return mAllocationStatus;
|
public synchronized AllocationInfo[] | getAllocations()Returns the list of tracked allocations.
return mAllocations;
|
public java.lang.String | getClientDescription()Returns the client description.
This is generally the name of the package defined in the
AndroidManifest.xml .
return mClientDescription;
|
public int | getDebuggerConnectionStatus()Returns the debugger connection status. Possible values are {@link #DEBUGGER_DEFAULT},
{@link #DEBUGGER_WAITING}, {@link #DEBUGGER_ATTACHED}, and {@link #DEBUGGER_ERROR}.
return mDebuggerInterest;
|
public synchronized java.util.List | getNativeAllocationList()Returns the list of {@link NativeAllocationInfo}.
return Collections.unmodifiableList(mNativeAllocationList);
|
com.android.ddmlib.ClientData$HeapData | getNativeHeapData()Returns the {@link HeapData} object for the native code.
return mNativeHeapData;
|
public synchronized java.util.Iterator | getNativeLibraryMapInfo()Returns an {@link Iterator} on {@link NativeLibraryMapInfo} objects.
The caller must synchronize on the {@link ClientData} object while iterating.
return mNativeLibMapInfo.iterator();
|
public int | getPid()Returns the process ID.
return mPid;
|
synchronized ThreadInfo | getThread(int threadId)Returns the {@link ThreadInfo} by thread id.
return mThreadMap.get(threadId);
|
public synchronized ThreadInfo[] | getThreads()Returns the list of threads as {@link ThreadInfo} objects.
The list is empty until a thread update was requested with
{@link Client#requestThreadUpdate()}.
Collection<ThreadInfo> threads = mThreadMap.values();
return threads.toArray(new ThreadInfo[threads.size()]);
|
public synchronized int | getTotalNativeMemory()Returns the total native memory.
return mNativeTotalMemory;
|
public com.android.ddmlib.ClientData$HeapData | getVmHeapData()Returns the {@link HeapData} object for the VM.
return mHeapData;
|
public synchronized java.util.Iterator | getVmHeapIds()Returns an iterator over the list of known VM heap ids.
The caller must synchronize on the {@link ClientData} object while iterating.
return mHeapInfoMap.keySet().iterator();
|
public synchronized java.util.Map | getVmHeapInfo(int heapId)Returns the most-recent info values for the specified VM heap.
return mHeapInfoMap.get(heapId);
|
public java.lang.String | getVmIdentifier()Returns the Client's VM identifier.
return mVmIdentifier;
|
public boolean | isDdmAware()Returns whether the process is DDM-aware.
return mIsDdmAware;
|
void | isDdmAware(boolean aware)Sets DDM-aware status.
mIsDdmAware = aware;
|
synchronized void | removeThread(int threadId)Removes a thread from the list.
mThreadMap.remove(threadId);
|
synchronized void | setAllocationStatus(boolean enabled)
mAllocationStatus = enabled ? ALLOCATION_TRACKING_ON : ALLOCATION_TRACKING_OFF;
|
synchronized void | setAllocations(AllocationInfo[] allocs)
mAllocations = allocs;
|
void | setClientDescription(java.lang.String description)Sets client description.
There may be a race between HELO and APNM. Rather than try
to enforce ordering on the device, we just don't allow an empty
name to replace a specified one.
if (mClientDescription == null && description.length() > 0) {
/*
* The application VM is first named <pre-initialized> before being assigned
* its real name.
* Depending on the timing, we can get an APNM chunk setting this name before
* another one setting the final actual name. So if we get a SetClientDescription
* with this value we ignore it.
*/
if (PRE_INITIALIZED.equals(description) == false) {
mClientDescription = description;
}
}
|
void | setDebuggerConnectionStatus(int val)Sets debugger connection status.
mDebuggerInterest = val;
|
synchronized void | setHeapInfo(int heapId, long maxSizeInBytes, long sizeInBytes, long bytesAllocated, long objectsAllocated)Sets the current heap info values for the specified heap.
HashMap<String, Long> heapInfo = new HashMap<String, Long>();
heapInfo.put(HEAP_MAX_SIZE_BYTES, maxSizeInBytes);
heapInfo.put(HEAP_SIZE_BYTES, sizeInBytes);
heapInfo.put(HEAP_BYTES_ALLOCATED, bytesAllocated);
heapInfo.put(HEAP_OBJECTS_ALLOCATED, objectsAllocated);
mHeapInfoMap.put(heapId, heapInfo);
|
synchronized void | setTotalNativeMemory(int totalMemory)
mNativeTotalMemory = totalMemory;
|
void | setVmIdentifier(java.lang.String ident)Sets VM identifier.
mVmIdentifier = ident;
|