8130297: com/sun/crypto/provider/KeyFactory/TestProviderLeak.java still failing after JDK-8076040
authorweijun
Thu, 02 Jul 2015 13:20:46 +0800
changeset 31473 650c75fa6728
parent 31472 850f01aa6a87
child 31474 7b79555b8073
8130297: com/sun/crypto/provider/KeyFactory/TestProviderLeak.java still failing after JDK-8076040 Reviewed-by: darcy
jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java
--- 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");