8130297: com/sun/crypto/provider/KeyFactory/TestProviderLeak.java still failing after JDK-8076040

Reviewed-by: darcy
This commit is contained in:
Weijun Wang 2015-07-02 13:20:46 +08:00
parent 8f2396ede1
commit 8804c9df5f

View File

@ -67,14 +67,16 @@ public class TestProviderLeak {
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");