diff --git a/jvm/jvm-annotations/src/main/java/org/quickperf/jvm/allocation/MeasureHeapAllocationPerfVerifier.java b/jvm/jvm-annotations/src/main/java/org/quickperf/jvm/allocation/MeasureHeapAllocationPerfVerifier.java index a3742947..72afa446 100644 --- a/jvm/jvm-annotations/src/main/java/org/quickperf/jvm/allocation/MeasureHeapAllocationPerfVerifier.java +++ b/jvm/jvm-annotations/src/main/java/org/quickperf/jvm/allocation/MeasureHeapAllocationPerfVerifier.java @@ -28,9 +28,11 @@ private MeasureHeapAllocationPerfVerifier() { } @Override public PerfIssue verifyPerfIssue(MeasureHeapAllocation annotation, Allocation measuredAllocation) { String allocationAsString = byteAllocationMeasureFormatter.format(measuredAllocation); - try (PrintWriter pw = new PrintWriter(System.out);) { - pw.printf(annotation.format(), allocationAsString); - } + PrintWriter pw = new PrintWriter(System.out); + pw.printf(annotation.format(), allocationAsString); + // do not call close on pw since it will call close on System.out + // thus preventing any further printing on the console + pw.flush(); return PerfIssue.NONE; }