changeset 31472:850f01aa6a87

8076040: Test com/sun/crypto/provider/KeyFactory/TestProviderLeak.java fails with -XX:+UseG1GC Reviewed-by: darcy
author weijun
date Thu, 02 Jul 2015 09:19:42 +0800
parents ae27c6f1d8bf
children 650c75fa6728
files jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java	Thu Jul 02 00:26:35 2015 +0300
+++ b/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java	Thu Jul 02 09:19:42 2015 +0800
@@ -66,9 +66,9 @@
                 megaByte = new byte [MB];
                 data.add(megaByte);
             } catch (OutOfMemoryError e) {
+                megaByte = null;    // Free memory ASAP
                 System.out.println("OOME is thrown when allocating "
                         + data.size() + "MB memory.");
-                megaByte = null;
 
                 for (int j = 0; j < RESERVATION && !data.isEmpty(); j++) {
                     data.removeLast();