Skip to content

Commit dc262df

Browse files
committed
8212218: [TESTBUG] runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryErrorInMetaspace.java timed out
Reviewed-by: iklam, lmesnik
1 parent 9eeeb8a commit dc262df

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

test/hotspot/jtreg/runtime/ErrorHandling/TestHeapDumpOnOutOfMemoryError.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,19 @@ public static void main(String[] args) throws Exception {
6666
static void test(String type) throws Exception {
6767
String heapdumpFilename = type + ".hprof";
6868
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+HeapDumpOnOutOfMemoryError",
69-
"-XX:HeapDumpPath=" + heapdumpFilename, "-XX:MaxMetaspaceSize=64m",
69+
"-XX:HeapDumpPath=" + heapdumpFilename,
70+
// Note: When trying to provoke a metaspace OOM we may generate a lot of classes. In debug VMs this
71+
// can cause considerable wait times since:
72+
// - Compiler Dependencies verification iterates the class tree
73+
// - Before exit, the CLDG is checked.
74+
// Both verifications show quadratic time or worse wrt to number of loaded classes. Therefore it
75+
// makes sense to switch one or both off and limit the metaspace size to something sensible.
76+
// Example numbers on a slow ppc64 machine:
77+
// MaxMetaspaceSize=64M - ~60-70K classes - ~20min runtime with all verifications
78+
// MaxMetaspaceSize=16M - ~12-15K classes - ~12sec runtime with all verifications
79+
// MaxMetaspaceSize=16M - ~12-15K classes - VerifyDependencies off - ~3seconds on ppc
80+
"-XX:MaxMetaspaceSize=16m",
81+
"-XX:-VerifyDependencies",
7082
TestHeapDumpOnOutOfMemoryError.class.getName(), type);
7183

7284
OutputAnalyzer output = new OutputAnalyzer(pb.start());

0 commit comments

Comments
 (0)