mirror of https://github.com/xzeldon/htop.git
netbsd: Fix display of in-use and cached memory
This commit is contained in:
parent
67ca214cbe
commit
4865e643ad
|
@ -102,14 +102,9 @@ static void NetBSDProcessList_scanMemoryInfo(ProcessList* pl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pl->totalMem = uvmexp.npages * pageSizeKB;
|
pl->totalMem = uvmexp.npages * pageSizeKB;
|
||||||
|
pl->buffersMem = 0;
|
||||||
// These calculations have been taken from NetBSD's top(1)
|
pl->cachedMem = (uvmexp.filepages + uvmexp.execpages) * pageSizeKB;
|
||||||
// They need review for testing the correctness
|
pl->usedMem = (uvmexp.active + uvmexp.wired) * pageSizeKB;
|
||||||
//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->totalSwap = uvmexp.swpages * pageSizeKB;
|
pl->totalSwap = uvmexp.swpages * pageSizeKB;
|
||||||
pl->usedSwap = uvmexp.swpginuse * pageSizeKB;
|
pl->usedSwap = uvmexp.swpginuse * pageSizeKB;
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,7 +236,6 @@ void Platform_setMemoryValues(Meter* this) {
|
||||||
long int usedMem = pl->usedMem;
|
long int usedMem = pl->usedMem;
|
||||||
long int buffersMem = pl->buffersMem;
|
long int buffersMem = pl->buffersMem;
|
||||||
long int cachedMem = pl->cachedMem;
|
long int cachedMem = pl->cachedMem;
|
||||||
usedMem -= buffersMem + cachedMem;
|
|
||||||
this->total = pl->totalMem;
|
this->total = pl->totalMem;
|
||||||
this->values[0] = usedMem;
|
this->values[0] = usedMem;
|
||||||
this->values[1] = buffersMem;
|
this->values[1] = buffersMem;
|
||||||
|
|
Loading…
Reference in New Issue