From 3cc2b049861893e4b53ea3547246491e410c987f Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 20 Nov 2004 02:55:22 +0000 Subject: [PATCH] more like linux free command --- bindings/java/src/net/hyperic/sigar/cmd/Free.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Free.java b/bindings/java/src/net/hyperic/sigar/cmd/Free.java index 4ceee238..a633b7b3 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Free.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Free.java @@ -37,6 +37,11 @@ public class Free extends SigarCommandBase { format(mem.getFree()) }; + Object[] actualRow = new Object[] { + format(mem.getActualUsed()), + format(mem.getActualFree()) + }; + Object[] swapRow = new Object[] { format(swap.getTotal()), format(swap.getUsed()), @@ -47,6 +52,13 @@ public class Free extends SigarCommandBase { printf("Mem: %10ld %10ld %10ld", memRow); + //e.g. linux + if ((mem.getUsed() != mem.getActualUsed()) || + (mem.getFree() != mem.getActualFree())) + { + printf("-/+ buffers/cache: " + "%10ld %10d", actualRow); + } + printf("Swap: %10ld %10ld %10ld", swapRow); printf("RAM: %10ls", new Object[] { mem.getRam() + "MB" });