diff --git a/netbsd/NetBSDProcessList.c b/netbsd/NetBSDProcessList.c index 35afd9ec..5c165088 100644 --- a/netbsd/NetBSDProcessList.c +++ b/netbsd/NetBSDProcessList.c @@ -102,14 +102,9 @@ static void NetBSDProcessList_scanMemoryInfo(ProcessList* pl) { } pl->totalMem = uvmexp.npages * pageSizeKB; - - // These calculations have been taken from NetBSD's top(1) - // They need review for testing the correctness - //pl->freeMem = uvmexp.free * pageSizeKB; - pl->buffersMem = uvmexp.filepages * pageSizeKB; - pl->cachedMem = (uvmexp.anonpages + uvmexp.filepages + uvmexp.execpages) * pageSizeKB; - pl->usedMem = (uvmexp.npages - uvmexp.free - uvmexp.paging) * pageSizeKB + pl->buffersMem + pl->cachedMem; - + pl->buffersMem = 0; + pl->cachedMem = (uvmexp.filepages + uvmexp.execpages) * pageSizeKB; + pl->usedMem = (uvmexp.active + uvmexp.wired) * pageSizeKB; pl->totalSwap = uvmexp.swpages * pageSizeKB; pl->usedSwap = uvmexp.swpginuse * pageSizeKB; } diff --git a/netbsd/Platform.c b/netbsd/Platform.c index 32e926aa..1b1a093b 100644 --- a/netbsd/Platform.c +++ b/netbsd/Platform.c @@ -236,7 +236,6 @@ void Platform_setMemoryValues(Meter* this) { long int usedMem = pl->usedMem; long int buffersMem = pl->buffersMem; long int cachedMem = pl->cachedMem; - usedMem -= buffersMem + cachedMem; this->total = pl->totalMem; this->values[0] = usedMem; this->values[1] = buffersMem;