diff --git a/li.strolch.utils/src/main/java/li/strolch/utils/helper/SystemHelper.java b/li.strolch.utils/src/main/java/li/strolch/utils/helper/SystemHelper.java index da92640ec..07c61530c 100644 --- a/li.strolch.utils/src/main/java/li/strolch/utils/helper/SystemHelper.java +++ b/li.strolch.utils/src/main/java/li/strolch/utils/helper/SystemHelper.java @@ -96,21 +96,27 @@ public class SystemHelper { return FileHelper.humanizeFileSize(Runtime.getRuntime().maxMemory()); } - public static String getUsedMemory() { + public static String getTotalMemory() { return FileHelper.humanizeFileSize(Runtime.getRuntime().totalMemory()); } + public static String getUsedMemory() { + return FileHelper.humanizeFileSize(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()); + } + public static String getFreeMemory() { return FileHelper.humanizeFileSize(Runtime.getRuntime().freeMemory()); } public static String getMemorySummary() { StringBuilder sb = new StringBuilder(); - sb.append("Memory available "); //$NON-NLS-1$ + sb.append("System Memory available "); //$NON-NLS-1$ sb.append(SystemHelper.getMaxMemory()); - sb.append(" / Used: "); //$NON-NLS-1$ + sb.append(", Total: "); //$NON-NLS-1$ + sb.append(SystemHelper.getTotalMemory()); + sb.append(", Used: "); //$NON-NLS-1$ sb.append(SystemHelper.getUsedMemory()); - sb.append(" / Free: "); //$NON-NLS-1$ + sb.append(", Free: "); //$NON-NLS-1$ sb.append(SystemHelper.getFreeMemory()); return sb.toString(); }