Random Project

mem usage not correctly calculated

Hi

Please check the calculation of the free memory (physical).

Currently this is the value of memused:

$memused = ($mem->{memused} / $mem->{memtotal}*100);

But you will have to calculate also with the cached memory.
> $memused = sprintf(“%.2f”, $memused – $memcached);

This is at least the real free memory.

Especially on RedHat based systems almost the whole physical memory will be allocated and only be provided for usage out of the cached memory. Means: once loaded component’s required memory stays reserved for the OS for faster re-allocation but it can be freed if the remaining physical memory goes down very fast.

Regards
Jochen