From 4f21c4cf077cfee5b35a56703618115614bc40f2 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 17 Sep 2009 10:24:05 -0700 Subject: [PATCH] Add API to retrieve memory used by running processes. Change-Id: I9c1935c2ef3c78bd67ec4dfd811a1caaab4514c3 --- api/current.xml | 46 +++++++++++++++++++ core/java/android/app/ActivityManager.java | 17 +++++++ .../android/app/ActivityManagerNative.java | 14 +++--- core/java/android/app/IActivityManager.java | 2 +- core/java/android/os/Debug.java | 21 +++++++++ .../server/am/ActivityManagerService.java | 21 +++------ 6 files changed, 98 insertions(+), 23 deletions(-) diff --git a/api/current.xml b/api/current.xml index 2c9a087530149..e64726a4d15c5 100644 --- a/api/current.xml +++ b/api/current.xml @@ -17563,6 +17563,19 @@ + + + + + + + + + + =0; i--) { + infos[i] = new Debug.MemoryInfo(); + Debug.getMemoryInfo(pids[i], infos[i]); } - - if (proc == null) { - throw new RemoteException(); - } - - IApplicationThread thread = proc.thread; - if (thread == null) { - throw new RemoteException(); - } - - thread.getMemoryInfo(mi); + return infos; } public void killApplicationProcess(String processName, int uid) {