From f704baeb8211815f80a166c6837f421a82e1c515 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Fri, 27 Nov 2020 13:22:21 +1100 Subject: Drop unused global ProcessList memory fields The global ProcessList structure contains a couple of unused fields. 'sharedMem' has never been used by any Meter, since its not been anything other than zero in Linux /proc/meminfo for many, many years. The freeMem field is only used in the usedMem calculation, so it can reside on the stack like some other memory variables used within-calculations-only and not exposed to the user via a Meter. --- freebsd/FreeBSDProcessList.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'freebsd') diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c index f2c11f92..9aaab5dd 100644 --- a/freebsd/FreeBSDProcessList.c +++ b/freebsd/FreeBSDProcessList.c @@ -314,12 +314,6 @@ static inline void FreeBSDProcessList_scanMemoryInfo(ProcessList* pl) { pl->usedMem = fpl->memActive + fpl->memWire; - //currently unused, same as with arc, custom meter perhaps - //sysctl(MIB_vm_stats_vm_v_inactive_count, 4, &(fpl->memInactive), &len, NULL, 0); - //sysctl(MIB_vm_stats_vm_v_free_count, 4, &(fpl->memFree), &len, NULL, 0); - //pl->freeMem = fpl->memInactive + fpl->memFree; - //pl->freeMem *= pageSizeKb; - struct kvm_swap swap[16]; int nswap = kvm_getswapinfo(fpl->kd, swap, ARRAYSIZE(swap), 0); pl->totalSwap = 0; @@ -330,8 +324,6 @@ static inline void FreeBSDProcessList_scanMemoryInfo(ProcessList* pl) { } pl->totalSwap *= pageSizeKb; pl->usedSwap *= pageSizeKb; - - pl->sharedMem = 0; // currently unused } static void FreeBSDProcessList_scanTTYs(ProcessList* pl) { -- cgit v1.2.3