summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/debugger.h2
-rw-r--r--test/098-ddmc/src/Main.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/runtime/debugger.h b/runtime/debugger.h
index c23b1b88f2..3b92d361f2 100644
--- a/runtime/debugger.h
+++ b/runtime/debugger.h
@@ -23,8 +23,6 @@
#include <pthread.h>
-#include <list>
-#include <map>
#include <set>
#include <string>
#include <vector>
diff --git a/test/098-ddmc/src/Main.java b/test/098-ddmc/src/Main.java
index f41ff2a94a..f74a17e0ac 100644
--- a/test/098-ddmc/src/Main.java
+++ b/test/098-ddmc/src/Main.java
@@ -43,8 +43,10 @@ public class Main {
System.out.println("Confirm when we overflow, we don't roll over to zero. b/17392248");
final int overflowAllocations = 64 * 1024; // Won't fit in unsigned 16-bit value.
+ // Keep the new objects live so they are not garbage collected.
+ Object[] objects = new Object[overflowAllocations];
for (int i = 0; i < overflowAllocations; i++) {
- new Object();
+ objects[i] = new Object();
}
Allocations after = new Allocations(DdmVmInternal.getRecentAllocations());
System.out.println("before < overflowAllocations=" + (before.numberOfEntries < overflowAllocations));
@@ -67,7 +69,7 @@ public class Main {
DdmVmInternal.enableRecentAllocations(true);
System.out.println("status=" + DdmVmInternal.getRecentAllocationStatus());
for (int i = 0; i < 16 * 1024; i++) {
- new String("fnord");
+ objects[i] = new String("fnord");
}
Allocations first = new Allocations(DdmVmInternal.getRecentAllocations());
DdmVmInternal.enableRecentAllocations(true);