It is confusing how "available" memory is calculated
Hello all, we are using available memory from the free command for alerting on low memory in our VM. But we found that when we run drop_cache
command available memory is getting increased. This is strange and not expected behaviour and might give us false alert.
Drop cache command
echo 2 > /proc/sys/vm/drop_caches
- To free reclaimable slab objects
AFAIK available memory includes reclaimable slab objects
. But after clearing only reclaimable slab objects
available memory is increasing.
Before dropping cache
total used free shared buff/cache available
Mem: 7.6G 4.2G 397M 331M 3.0G 2.7G
Swap: 4.0G 429M 3.6G
After dropping cache
total used free shared buff/cache available
Mem: 7.6G 3.3G 3.8G 331M 483M 3.8G
Swap: 4.0G 429M 3.6G
Is my understanding about available wrong?. How actually is available memory calculated?
Edited by Swastik K