Why don't I have the memory or disk allowance that I expect?

Last updated: November 29th 2024

Introduction

We sometimes get asked the question on our support: Why don't I see the 10 gigabye of RAM available I paid for inside my machine?

Well, in short, this has to do with the kernel reserving some things reducing what you see returned from commands such as "free" but mostly from a conversion from GB to GiB/MiB. Let us explain ...

The kernel/system reserves some stuff, when it comes to memory (and disk)

For disk allowance it should be obvious that your Linux system will reserve some part of your raw disk allowance for /boot, firmware and efi and other bits and pieces.

Any remainder you have will be shown in the case of tools like df as MiB or GiB converted from your allowance which is set in GB or MB. This means that you will always see a bit less disk space as absolute numbers reported from such tools. It's just unit conversion.

As to memory; if you run a tool such as free you may see a rather low number compared to what you may expect. Here is an example:

root@v1:~# dmidecode -t 17 | grep Size: 
Size: 768 MB 

root@v1:~# free -m 
total used free shared buff/cache available 
Mem: 699 222 255 23 347 477 
Swap: 0 0 0

This is just firmware and kernel taking a bit of reserved memory for various things, reducing the actual physical memory available in this example from 768 MiB to 699MiB. Notice how we write MiB here? That's because dmidecode is "lying" about its units. It's not actually displaying MB (which is a multiple of 1000) but MiB (which is multiples of 1024)

This also explains why you may see something like this reported by dmidecode on a VPS server with 10GB RAM allowance:

root@dakara:~$ incus exec v1 -- dmidecode -t 17 | grep  Size:
Size: 9536 MB

If the unit was in fact MB, this should show 10000 MB but it doesn't because dmidecode is actually showing MiB, where 10GB to MiB = 9536 MiB

We hope that clears up any confusion, otherwise please ask in our support and we will try and improve our explanation here best we can :) Thanks for reading!

Related articles