Linux: overhaul memory partition

Use similar calculation than procps.
Show AvailableMemory in text mode.
Use total minus available memory instead of manually computed used-
memory as fraction part in bar mode (if available).
This commit is contained in:
Christian Göttsche
2021-01-06 18:11:24 +01:00
parent 0d67263b36
commit 3d497a3760
7 changed files with 103 additions and 63 deletions

View File

@ -74,8 +74,10 @@ typedef struct LinuxProcessList_ {
int netlink_family;
#endif
unsigned long long int totalHugePageMem;
unsigned long long int usedHugePageMem[HTOP_HUGEPAGE_COUNT];
memory_t totalHugePageMem;
memory_t usedHugePageMem[HTOP_HUGEPAGE_COUNT];
memory_t availableMem;
ZfsArcStats zfs;
ZramStats zram;