changeset 12318:44ed891c5e74

8130297: com/sun/crypto/provider/KeyFactory/TestProviderLeak.java still failing after JDK-8076040 Reviewed-by: darcy
author weijun
date Thu, 02 Jul 2015 13:20:46 +0800
parents bcd77fbb58e2
children 47d6ef0dd448
files test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java	Thu Jul 02 09:19:42 2015 +0800
+++ b/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");