MemTotal
mostra
Total usable RAM (i.e., physical RAM minus a few reserved bits and the kernel binary code).
Você não pode usar isso para determinar a memória instalada exata, exceto usando heurísticas ...
Para determinar a memória instalada real, você deve usar lshw
ou dmidecode
, o que mostrará o tamanho dos módulos instalados; por exemplo, de lshw
:
*-memory
description: System Memory
physical id: 4c
slot: System board or motherboard
size: 32GiB
capabilities: ecc
configuration: errordetection=ecc
ou de forma mais compacta ( lshw -class memory -short
):
H/W path Device Class Description
=========================================================
/0/0 memory 64KiB BIOS
/0/47/48 memory 256KiB L1 cache
/0/47/49 memory 1MiB L2 cache
/0/47/4a memory 8MiB L3 cache
/0/4c memory 32GiB System Memory
/0/4c/0 memory 8GiB DIMM DDR3 Synchronous 1600 MHz (0.6 ns)
/0/4c/1 memory 8GiB DIMM DDR3 Synchronous 1600 MHz (0.6 ns)
/0/4c/2 memory 8GiB DIMM DDR3 Synchronous 1600 MHz (0.6 ns)
/0/4c/3 memory 8GiB DIMM DDR3 Synchronous 1600 MHz (0.6 ns)