summaryrefslogtreecommitdiff
path: root/core/java/android/app/IApplicationThread.java
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2010-07-09 16:26:57 -0700
committerAndy McFadden <fadden@android.com>2010-07-12 13:35:14 -0700
commit824c510752fd6a30cdba5ed7324cb80a5043ce26 (patch)
tree701346031a5b93e71c73f4786f1a276e1f6053db /core/java/android/app/IApplicationThread.java
parent2707d6026240bcca6f0e35e2e1138958882e90ce (diff)
Allow "am" to initiate heap dumps.
This was mostly cloned from the "am profile" implementation. It's intended to replace the old "kill -10" approach used by "runhat". We could really use a native heap dump, so I pass a "managed" flag through that indicates whether we want to dump the native or managed heap. We don't currently have a native heap dump-to-file function, so it currently just logs a warning. (android.ddm.DdmHandleNativeHeap.getLeakInfo is a good start -- it copies /proc/maps and then calls get_malloc_leak_info to get some goodies. Needs some formatting to make it human-readable. I didn't want to cram all that into this change.) It would be useful if "am" didn't exit until the heap dump operation completed, but I'm not sure how to do that. Bug 2759474. Change-Id: I46bc98067738d8c72ac0fc10002ca67bb4929271
Diffstat (limited to 'core/java/android/app/IApplicationThread.java')
-rw-r--r--core/java/android/app/IApplicationThread.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/java/android/app/IApplicationThread.java b/core/java/android/app/IApplicationThread.java
index c8ef17f1b7a9..039bcb9f6b0e 100644
--- a/core/java/android/app/IApplicationThread.java
+++ b/core/java/android/app/IApplicationThread.java
@@ -97,6 +97,8 @@ public interface IApplicationThread extends IInterface {
void scheduleActivityConfigurationChanged(IBinder token) throws RemoteException;
void profilerControl(boolean start, String path, ParcelFileDescriptor fd)
throws RemoteException;
+ void dumpHeap(boolean managed, String path, ParcelFileDescriptor fd)
+ throws RemoteException;
void setSchedulingGroup(int group) throws RemoteException;
void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException;
static final int PACKAGE_REMOVED = 0;
@@ -140,4 +142,5 @@ public interface IApplicationThread extends IInterface {
int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32;
int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33;
int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34;
+ int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35;
}