List of utility methods to do Memory Information
String | getNowMemoryStatus() get Now Memory Status return nowMemoryStatus;
|
String | getRuntimeMemoryStats() Get stringified runtime memory stats return String.format("Memory (free/total/max) = %.2fM / %.2fM / %.2fM", freeMemoryMB(), totalMemoryMB(), maxMemoryMB()); |
String | getRuntimeMemoryStats() Get stringified runtime memory stats return "totalMem = " + (Runtime.getRuntime().totalMemory() / 1024f / 1024f) + "M, maxMem = " + (Runtime.getRuntime().maxMemory() / 1024f / 1024f) + "M, freeMem = " + (Runtime.getRuntime().freeMemory() / 1024f / 1024f) + "M"; |
String[] | getSummaryMemoryReportHeader() get Summary Memory Report Header final String[] header = { "ontology", "query", "rew mem [Kb]", "depgraph mem [Kb]" }; return header; |
String | getTotalMemoryStringInMb() get Total Memory String In Mb return memroyFormat.format(getTotalMemoryInMb());
|
int | parseMemory(String s, int def) parse Memory try { return Integer.parseInt(s); } catch (Exception e) { int a = parseInt(s.substring(0, s.length() - 1), def); if (s.endsWith("g")) return a * 1024; else if (s.endsWith("k")) return a / 1024; ... |
long | parseMemorySize(String arg) Parses a memory size with optional g/m/k quantifiers into its number representation. if (arg.endsWith("g") || arg.endsWith("G")) return Long.parseLong(arg.substring(0, arg.length() - 1)) * 1024 * 1024 * 1024; else if (arg.endsWith("m") || arg.endsWith("M")) return Long.parseLong(arg.substring(0, arg.length() - 1)) * 1024 * 1024; else if (arg.endsWith("k") || arg.endsWith("K")) return Long.parseLong(arg.substring(0, arg.length() - 1)) * 1024; else return Long.parseLong(arg.substring(0, arg.length())); ... |
String | prettyPrintMemory(long size, boolean includeSpace) pretty Print Memory if (size >= 1 << 30) return String.format("%.3f%sGiB", size / (double) (1 << 30), includeSpace ? " " : ""); if (size >= 1 << 20) return String.format("%.3f%sMiB", size / (double) (1 << 20), includeSpace ? " " : ""); return String.format("%.3f%sKiB", size / (double) (1 << 10), includeSpace ? " " : ""); |
String | prettyPrintMemoryPerSecond(long rate) pretty Print Memory Per Second if (rate >= 1 << 30) return String.format("%.3fGiB/s", rate / (double) (1 << 30)); if (rate >= 1 << 20) return String.format("%.3fMiB/s", rate / (double) (1 << 20)); return String.format("%.3fKiB/s", rate / (double) (1 << 10)); |
String | printMemory() print Memory return printMemory(null);
|