Index: build/android/pylib/android_commands.py |
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py |
index 1741619276ce56042a9a3df6f3b004fed1ebe3ad..516fba2c32b6da774053ed3dc23b6c62be3f2c06 100644 |
--- a/build/android/pylib/android_commands.py |
+++ b/build/android/pylib/android_commands.py |
@@ -21,6 +21,9 @@ import time |
import cmd_helper |
import constants |
+ |
+from utils import host_path_finder |
+ |
try: |
from pylib import pexpect |
except: |
@@ -1409,6 +1412,19 @@ class AndroidCommands(object): |
logging.warning('Could not find disk IO stats.') |
return None |
+ def PurgeUnpinnedAshmem(self): |
+ """Purges the unpinned ashmem memory for the whole system. |
+ |
+ This can be used to make memory measurements more stable in particular. |
+ """ |
+ host_path = host_path_finder.GetMostRecentHostPath('purge_ashmem') |
+ if host_path: |
+ device_path = os.path.join(constants.TEST_EXECUTABLE_DIR, 'purge_ashmem') |
+ self.PushIfNeeded(host_path, device_path) |
+ if self.RunShellCommand(device_path, log_result=True): |
+ return |
+ logging.error('Could not purge ashmem. Measurement might be unstable.') |
frankf
2013/11/05 19:22:56
Generally, we're moving to make these methods more
Philippe
2013/11/06 16:51:09
Done.
|
+ |
def GetMemoryUsageForPid(self, pid): |
"""Returns the memory usage for given pid. |