8078826: Add diagnostic info for java/lang/Runtime/exec/LotsOfOutput.java fails intermittently
authorrriggs
Tue, 28 Apr 2015 09:28:24 -0400
changeset 30040 b37962ee211c
parent 30039 7f5a75df6e5f
child 30041 73715a39a677
8078826: Add diagnostic info for java/lang/Runtime/exec/LotsOfOutput.java fails intermittently Summary: add debugging output for diagnose intermittent failure Reviewed-by: chegar, joehw
jdk/test/java/lang/Runtime/exec/LotsOfOutput.java
--- a/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java	Mon Apr 27 16:31:47 2015 -0400
+++ b/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java	Tue Apr 28 09:28:24 2015 -0400
@@ -41,7 +41,12 @@
         long initMemory = Runtime.getRuntime().totalMemory();
         for (int i=1; i< 10; i++) {
             Thread.sleep(100);
-            if (Runtime.getRuntime().totalMemory() > initMemory + 1000000)
+            long totalMemory = Runtime.getRuntime().totalMemory();
+            if (totalMemory != initMemory) {
+                System.out.printf("consuming memory: i: %d, initial: %d, total: %d, delta: %d%n",
+                        i, initMemory, totalMemory, totalMemory - initMemory);
+            }
+            if (totalMemory > initMemory + 1000000)
                 throw new Exception("Process consumes memory.");
         }