[ https://issues.apache.org/jira/browse/AMBARI-25823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17649692#comment-17649692 ]
Ravuri Sushma sree commented on AMBARI-25823: --------------------------------------------- [~brahma] , Can you please add me as a contributor for Ambari so I can contribute some fixes. Thank you! > 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 > Priority: Major > > 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: issues-unsubscr...@ambari.apache.org For additional commands, e-mail: issues-h...@ambari.apache.org