mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
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;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user