mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-04 17:52:52 +00:00
8078826: Add diagnostic info for java/lang/Runtime/exec/LotsOfOutput.java fails intermittently
Add debugging output for diagnose intermittent failure Reviewed-by: chegar, joehw
This commit is contained in:
parent
642e0ac6f1
commit
41b36c4295
@ -41,7 +41,12 @@ public class LotsOfOutput {
|
||||
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.");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user