Understanding physical memory characteristics on a Linux system clarifies how much RAM is available, how it is used, and whether hardware matches expectations from vendor specifications or capacity planning.
The kernel tracks memory in pages and exposes aggregate statistics through interfaces such as /proc/meminfo, while user-space tools like free, top, and vmstat format these counters into human-readable summaries. Hardware-oriented utilities such as dmidecode read firmware data to reveal module size, type, speed, and manufacturer for each installed memory device.
Collecting information from several commands provides a fuller picture than relying on a single tool, especially on systems with swap, huge pages, or NUMA layouts. Some utilities require elevated privileges or may not be available in minimal containers, so attention to permissions, package availability, and environment (physical host versus virtual machine) avoids confusing partial outputs.
Related: How to check memory usage in Linux
Related: How to benchmark memory speed in Linux
$ whoami user
Membership in the sudo or wheel group allows running privileged commands when needed.
$ free -h
total used free shared buff/cache available
Mem: 3.8Gi 305Mi 3.0Gi 4.3Mi 692Mi 3.5Gi
Swap: 2.0Gi 0B 2.0Gi
The Mem line shows physical RAM, while the Swap line shows configured swap space in a human-readable format.
$ cat /proc/meminfo MemTotal: 3995176 kB MemFree: 3126308 kB MemAvailable: 3682564 kB Buffers: 28020 kB Cached: 653172 kB SwapTotal: 2097148 kB SwapFree: 2097148 kB ##### snipped #####
Fields such as MemAvailable and Cached help distinguish real pressure from simple file caching.
$ sudo dmidecode --type memory # dmidecode 3.5 Getting SMBIOS data from sysfs. SMBIOS 3.2.0 present. Handle 0x0005, DMI type 16, 23 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None Maximum Capacity: 4 GB Error Information Handle: Not Provided Number Of Devices: 1 Handle 0x0006, DMI type 17, 92 bytes Memory Device Array Handle: 0x0005 Error Information Handle: 0x0000 Total Width: 32 bits Data Width: 32 bits Size: 4 GB Form Factor: DIMM Set: None Locator: Not Specified Bank Locator: Not Specified Type: DRAM Type Detail: EDO Speed: Unknown Manufacturer: Not Specified Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Rank: 1 Configured Memory Speed: Unknown ##### snipped #####
Running dmidecode requires root access and may expose serial numbers and other hardware identifiers that should not be shared publicly.
$ lsmem RANGE SIZE STATE REMOVABLE BLOCK 0x0000000040000000-0x000000013fffffff 4G online yes 8-39 Memory block size: 128M Total online memory: 4G Total offline memory: 0B
If lsmem is not installed, install the util-linux package using the distribution package manager.
$ top top - 14:51:57 up 6:47, 2 users, load average: 0.05, 0.02, 0.00 Tasks: 118 total, 1 running, 116 sleeping, 0 stopped, 1 zombie %Cpu(s): 0.0 us, 4.5 sy, 0.0 ni, 95.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 3901.5 total, 3052.4 free, 305.9 used, 693.1 buff/cache MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 3595.7 avail Mem
Press Shift+M to sort processes by memory usage and q to quit top.
$ htop 1 [|||||||||||||||||||||||||| 35.0%] Tasks: 199, 1 running Mem[||||| 2.34G/15.7G] Swp[ 0K/2.0G]
If htop is not present, install it using the distribution package manager, for example sudo apt install --assume-yes htop on Ubuntu.
$ vmstat -s
3995176 K total memory
313200 K used memory
275676 K active memory
438396 K inactive memory
3125644 K free memory
28020 K buffer memory
681680 K swap cache
2097148 K total swap
0 K used swap
2097148 K free swap
##### snipped #####
The snapshot from vmstat -s can be combined with repeated runs or logging to observe trends in memory pressure over time.
$ free --giga
total used free shared buff/cache available
Mem: 4 0 3 0 0 3
Swap: 2 0 2
Minor differences between advertised capacity and reported size are normal because of reserved regions, but large discrepancies can indicate mis-seated modules or firmware limitations.