96bce4e11e
Under a lxc container, the /proc/meminfo 'MemFree' and 'MemAvailable' amounts will be equal, unless memory is being limited via cgroups in which case 'MemAvailable' could exceed that for 'MemTotal'. And when a container has been nested, there exist additional memory quirks. A program might then display used or available amounts greater than total memory (assuming unsigned honored), or negative values (should a signed cast be employed). This anomaly primarily impacted the top and free pgms. Thus, two simple sanity checks have been introduced to avoid any illogical kb_main_available or kb_main_used. ( Busybox top & free also display anomalous although ) ( different results when running in a lxc container. ) Reference(s): https://bugzilla.redhat.com/show_bug.cgi?id=1153817 Signed-off-by: Jim Warner <james.warner@comcast.net>