Skip to content
Snippets Groups Projects
Commit 8dbd6772 authored by Amos Shi's avatar Amos Shi
Browse files

8315576: compiler/codecache/CodeCacheFullCountTest.java fails after JDK-8314837

Reviewed-by: phh
Backport-of: 343cc0ce2bba797e206f6b7312018a8c6d1bdb66
parent c1034091
No related branches found
No related tags found
No related merge requests found
......@@ -45,13 +45,21 @@ public class CodeCacheFullCountTest {
}
}
public static void wasteCodeCache() throws Exception {
public static void wasteCodeCache() throws Throwable {
URL url = CodeCacheFullCountTest.class.getProtectionDomain().getCodeSource().getLocation();
try {
for (int i = 0; i < 500; i++) {
ClassLoader cl = new MyClassLoader(url);
refClass(cl.loadClass("SomeClass"));
}
} catch (Throwable t) {
// Expose the root cause of the Throwable instance.
while (t.getCause() != null) {
t = t.getCause();
}
throw t;
}
}
public static void runTest() throws Throwable {
......@@ -59,7 +67,7 @@ public class CodeCacheFullCountTest {
"-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "CodeCacheFullCountTest", "WasteCodeCache");
OutputAnalyzer oa = ProcessTools.executeProcess(pb);
// Ignore adapter creation failures
if (oa.getExitValue() != 0 && !oa.getStderr().contains("Out of space in CodeCache for adapters")) {
if (oa.getExitValue() != 0 && !oa.getOutput().contains("Out of space in CodeCache for adapters")) {
oa.reportDiagnosticSummary();
throw new RuntimeException("VM finished with exit code " + oa.getExitValue());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment