- Newest
- Most votes
- Most comments
The discrepancy seen with the metric mem_used_percent via CW agent(on Beanstalk Instances) for Used Memory is because Cloud Watch agent will pass the values through a formula before reporting the values.
The formula used is:
Used Memory = MemTotal – (MemFree + Buffers + Cached)
mem_used_percent = (Used Memory/MemTotal) * 100.
Here the values for MemTotal, MemFree, Buffers and Cached are retrieved from /proc/meminfo
This value will be different as its not solely Used Memory as in the free -m output or top output but a calculation that accurately determines Memory usage of a Linux Machine.
Can you please provide the formula that is used for the calculation in Elastic Beanstalk, too ? Thank you.
The discrepancy seen with the metric mem_used_percent via CW agent(on Beanstalk Instances) for Used Memory is because Cloud Watch agent will pass the values through a formula before reporting the values.
The formula used is:
Used Memory = MemTotal – (MemFree + Buffers + Cached)
mem_used_percent = (Used Memory/MemTotal) * 100.
Here the values for MemTotal, MemFree, Buffers and Cached are retrieved from /proc/meminfo
This value will be different as its not solely Used Memory as in the free -m output or top output but a calculation that accurately determines Memory usage of a Linux Machine.
answered 2 years ago
Relevant content
asked 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 16 days ago

Hi, I was having issues too with understanding how the memory usage was calculated by the Enhanced instance health because the free memory that I was seeing was not matching the alert on the memory.
From a practical point of view It should be using the avail Mem top command value (which is not the same as the free memory) because running the calculation in my case matches exactly the percentage shown in the alert.