diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java b/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java index d5be7994..527b354e 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java @@ -120,7 +120,7 @@ public final class JvmInformation { } /** - * Returns the total amount of memory used by the JVM and the running application. + * Returns the total amount of memory used the running application AND JVM. *
* Note: This is an estimate. * @@ -151,6 +151,16 @@ public final class JvmInformation { return Runtime.getRuntime().freeMemory(); } + /** + * Returns the amount of memory used by the running application. + * + * @return amount of used memory + * @since 1-alpha1 + */ + public static long getMemoryUsed() { + return getMemoryMax() - getMemoryFree(); + } + /** * Returns the memory usage of the heap. *