8130297: com/sun/crypto/provider/KeyFactory/TestProviderLeak.java still failing after JDK-8076040
Reviewed-by: darcy
--- a/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java Thu Jul 02 09:19:42 2015 +0800
+++ b/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java Thu Jul 02 13:20:46 2015 +0800
@@ -67,14 +67,16 @@
data.add(megaByte);
} catch (OutOfMemoryError e) {
megaByte = null; // Free memory ASAP
- System.out.println("OOME is thrown when allocating "
- + data.size() + "MB memory.");
+
+ int size = data.size();
for (int j = 0; j < RESERVATION && !data.isEmpty(); j++) {
data.removeLast();
}
System.gc();
hasException = true;
+ System.out.println("OOME is thrown when allocating "
+ + size + "MB memory.");
}
}
dumpMemoryStats("After memory allocation");