-
Couldn't load subscription status.
- Fork 3
Description
I had a look at the implementation of how we calculate memory metrics for this support issue.
We subtracts the free, cached and buffer values from the total memory to calculate the used memory.
This then results in the 'active' memory if I would have to give that a name, although that may not be the same as the full used memory.
I made that implementation 7 years ago as part of PR #27, and the details around it are a little fuzzy for me.
From the commit I can tell it had something to do with the memory calculations for Docker containers, something which now has a separate implementation. So, maybe it's no longer the best method of reporting for VMs now.
In the case of the customer's question, they had 58GB of 'cached' memory. This create the difference of htop reporting 61GB of memory used and AppSignal reporting 3GB of memory used.
I can think of us reporting these as different 'states' for the memory host metrics:
- the 'full usage' including caches and buffers, and;
- one for 'active usage' without them.
Change the default 'used' one to be the 'full usage' one so it reports a higher value and is (what may be) what people expect.
We could even report the caches and buffers values if we think it's useful.