more like linux free command

This commit is contained in:
Doug MacEachern 2004-11-20 02:55:22 +00:00
parent bae9ea52b8
commit 3cc2b04986
1 changed files with 12 additions and 0 deletions

View File

@ -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" });