Whoops, need to acquire lock.
Also increase time between reports to try to reduce the amount
of redundant spam we get.
Change-Id: Iedd7d743826fffa62ee431073cb7dfb49a00cea0
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index b6f1184..c0af2f6 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -1211,8 +1211,8 @@
}
synchronized (ActivityManagerService.this) {
long now = SystemClock.uptimeMillis();
- if (now < (mLastMemUsageReportTime+10000)) {
- // Don't report more than every 10 seconds to somewhat
+ if (now < (mLastMemUsageReportTime+5*60*1000)) {
+ // Don't report more than every 5 minutes to somewhat
// avoid spamming.
return;
}
@@ -1250,12 +1250,14 @@
PrintWriter catPw = new PrintWriter(catSw);
String[] emptyArgs = new String[] { };
StringBuilder tag = new StringBuilder(128);
- dumpProcessesLocked(null, catPw, emptyArgs, 0, false);
- catPw.println();
- dumpServicesLocked(null, catPw, emptyArgs, 0, false, false);
- catPw.println();
- dumpActivitiesLocked(null, catPw, emptyArgs, 0, false, false);
- catPw.println();
+ synchronized (ActivityManagerService.this) {
+ dumpProcessesLocked(null, catPw, emptyArgs, 0, false);
+ catPw.println();
+ dumpServicesLocked(null, catPw, emptyArgs, 0, false, false);
+ catPw.println();
+ dumpActivitiesLocked(null, catPw, emptyArgs, 0, false, false);
+ catPw.println();
+ }
tag.append("Low on memory -- ");
dumpApplicationMemoryUsage(null, pw, " ", emptyArgs, true, catPw, tag);
String memUsage = sw.toString();