summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2017-11-13 16:26:02 -0800
committer Mathieu Chartier <mathieuc@google.com> 2017-11-13 16:27:42 -0800
commit87c9317d22d544dea96e6d6dbe31647e7ff270f9 (patch)
treec34259265f48ef2f257767ae5d6fbfbbec1f9a77
parent43b475f4d2d359e9161455aacc92307f3f23f1b8 (diff)
Make sure VMClassLoader is initialized before eating up the RAM
Otherwise there may be an OOME when trying to resolve the class. When this happens, it causes an abort in WrapExceptionInInitializer since the class is in the bootstrap classloader. Test: test-art-host Bug: 69149957 Change-Id: I3cb79e8cffef758799d8c57ca5132d65a10e75ea
-rw-r--r--test/163-app-image-methods/src/Main.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/163-app-image-methods/src/Main.java b/test/163-app-image-methods/src/Main.java
index a995bb8412..c513470b7b 100644
--- a/test/163-app-image-methods/src/Main.java
+++ b/test/163-app-image-methods/src/Main.java
@@ -22,6 +22,9 @@ public class Main {
// Allocate memory for the "AAA.Derived" class name before eating memory.
String aaaDerivedName = "AAA.Derived";
System.out.println("Eating all memory.");
+ // Resolve VMClassLoader before eating all the memory since we can not fail
+ // initializtaion of boot classpath classes.
+ Class.forName("java.lang.VMClassLoader");
Object memory = eatAllMemory();
// This test assumes that Derived is not yet resolved. In some configurations