You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of guessing how much memory a system has from /proc/meminfo, it's possible to get an exact value using sysfs.
For example, the lshw util queries the /sys/devices/system/memory dir for available memory blocks and uses /sys/devices/system/memory/block_size_bytes as the block size. Check that each memory block is online by checking the value of /sys/devices/system/memory/memory*/online
Instead of guessing how much memory a system has from /proc/meminfo, it's possible to get an exact value using sysfs.
For example, the lshw util queries the /sys/devices/system/memory dir for available memory blocks and uses /sys/devices/system/memory/block_size_bytes as the block size. Check that each memory block is online by checking the value of
/sys/devices/system/memory/memory*/online
Here's the documentation on the sysfs memory blocks https://www.ibm.com/support/knowledgecenter/en/linuxonibm/com.ibm.linux.z.lgdd/lgdd_c_mem_know_sysfs.html
Here's a one-liner:
printf '%c' /sys/devices/system/memory/memory*/online | wc -c | dc -e '?16i' -f /sys/devices/system/memory/block_size_bytes -e '*p' | numfmt --to=iec-i --suffix B
The text was updated successfully, but these errors were encountered: