3

I have a system with 8 x 16 GB DIMMs, so 128 GB total.

However, the MemTotal reported by /proc/meminfo is 131927808 kB, so 131 GB

My research suggests that if anything, the meminfo should add up up to less than the RAM total.

https://www.thegeekdiary.com/understanding-proc-meminfo-file-analyzing-memory-utilization-in-linux/

So Google's calculator reports this sum as 131 (just divided by 1000000)

https://www.google.com/search?q=131927808+kB+to+GB

If you interpret the kB to mean kibibytes it is instead: 135 GB (worse!)

If you make it Kibibytes to Gibibytes it's 125

Or Kilobytes to Gigabytes it's 122

Below are the details. Can anyone help me understand this discrepancy? Thanks!

# cat /proc/meminfo
MemTotal:       131927808 kB
MemFree:         3186732 kB
MemAvailable:   99191856 kB
Buffers:         3476036 kB
Cached:         115792344 kB
SwapCached:       120540 kB
Active:         80544652 kB
Inactive:       45017236 kB
Active(anon):   28044884 kB
Inactive(anon):  3127872 kB
Active(file):   52499768 kB
Inactive(file): 41889364 kB
Unevictable:       13040 kB
Mlocked:        584115752720 kB
SwapTotal:       1953788 kB
SwapFree:              0 kB
  • 1
    131927808 / 1024 = 128835 MB, 128835 / 1024 = 125 GB. Seems about right to me given overhead and manufacturers not being completely upfront about actual sizes. – Jesse_b Nov 16 at 21:09
  • 1
    Some memory is reserved by BIOS/kernel during the boot process. Look at dmesg | grep Memory: output – edo1 Nov 16 at 21:38
  • 1
    Just an fyi when the rest of the world switched from KB to KiB because they don't know how computers work, the computers didn't care. A kilobyte is still 1024 bytes to a computer. – Jesse_b Nov 16 at 21:53
5

Memory capacity in DIMMs is measured in powers of two, so a claimed RAM capacity of “128 giga-something” is 128 GiB which is 134,217,728 kiB. /proc/meminfo also measures memory in powers of two, so the MemTotal value of 131,927,808 can be compared with 134,217,728 and is safely less.

MemTotal is the total installed physical memory minus whatever is reserved by the system firmware and the kernel binary. Your boot log should contain a line of the form

... [    0.000000] Memory: 32784756K/33435864K available (10252K kernel code, 1243K rwdata, 3324K rodata, 1584K init, 2280K bss, 651108K reserved, 0K cma-reserved)

which will indicate exactly how much is reserved by the system (the “reserved” figure) and the kernel binary (the “kernel code” figure).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.