X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.nativemem%2Fsrc%2Forg%2Fsimantics%2Fnativemem%2Finternal%2FCMemoryInfo.java;h=7412a73ffc6b2cb1c1be89567cb27dc9e82aaef4;hb=ea17057d1c483f8a2bcb765527e45cf4fba36df5;hp=aca7fa9e559a655554326665d22ddd90fda0c365;hpb=99f23679ed1b7c4a47cd841fa75be142225eb7aa;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.nativemem/src/org/simantics/nativemem/internal/CMemoryInfo.java b/bundles/org.simantics.nativemem/src/org/simantics/nativemem/internal/CMemoryInfo.java index aca7fa9e5..7412a73ff 100644 --- a/bundles/org.simantics.nativemem/src/org/simantics/nativemem/internal/CMemoryInfo.java +++ b/bundles/org.simantics.nativemem/src/org/simantics/nativemem/internal/CMemoryInfo.java @@ -28,12 +28,29 @@ public class CMemoryInfo implements ProcessMemoryInfo { + peakRSS + "]"; } + @Override public String toHumanReadableString() { StringBuilder sb = new StringBuilder(); - sb.append("Memory Use [Current RSS = ").append(currentRSS) - .append(" MB, Peak RSS = ").append(Util.toMb(peakRSS)) - .append(" MB]"); + sb.append("RSS ").append(Util.toMb(currentRSS)) + .append("M / ").append(Util.toMb(peakRSS)) + .append("M"); return sb.toString(); } + @Override + public String headerRow() { + return "RSS [MB]\tPeak RSS [MB]"; + } + + @Override + public String dataRow() { + return Util.toMb(currentRSS) + "\t" + Util.toMb(peakRSS); + } + + public static void main(String[] args) { + System.out.println(new CMemoryInfo().toHumanReadableString()); + System.out.println(new CMemoryInfo().headerRow()); + System.out.println(new CMemoryInfo().dataRow()); + } + } \ No newline at end of file