changeset 12301:bcd77fbb58e2

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 5334dcf58681
children 44ed891c5e74
files test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java	Thu Jul 02 00:26:35 2015 +0300
+++ b/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();