Ravuri Sushma sree created AMBARI-25823:
-------------------------------------------
Summary: Fix the widget.json for the Host memory used %
Key: AMBARI-25823
URL: https://issues.apache.org/jira/browse/AMBARI-25823
Project: Ambari
Issue Type: Bug
Reporter: Ravuri Sushma sree
Heatmap is displayed wrongly. The main reason for that is currently the formula
used is
"value": "${((mem_total - mem_cached - mem_free)/mem_total)*100}"
But as per host_info.py
'mem_free': bytes2kilobytes(mem_stats.available) if hasattr(mem_stats,
'available') else 0, # the actual amount of available memory
We mark the 'available' memory from psutil.virtual_memory() command as the free
memory. Basically this is wrong. 'free' memory is the memory available after
the cached memory getting reduced from total memory but the 'available' memory
is the total available memory including the cached memory as that can be
reclaimed anytime.
So mem_free is nothing but mem_available. So in the host memory used heat map
we should just do
(mem_total-mem_free)/mem_total to get the used memory fraction.
This is what psutil.virtual_memory() internally does to get the used percentage.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]