Showing lesser ram than available

I was planning to migrate my 4 to 5 ubuntu server to Rocky and doing a prior testing.

I’d noticed that same server (Hetzner CPX 21 Plan with 4 GB ram) with ubuntu and rocky linux shows different Ram

Ubuntu is showing 3815 mb and Rocky is showing 3557
why this difference despite the same server?

Is this simply due to the fact that rocky doesn’t shows the kernel memory usage?

attached is the screenshot of details

I wouldn’t worry about it. I see different values between Rocky 8 and Rocky 9 on two VM’s I have on VMware that have 4GB allocated. One has 3921 the other 3659.

You could have crashkernel/kdump enabled which can take 256MB of memory. Eg:

[root@rocky9 ~]# dmesg | grep -i crashkernel | grep -i reserv
[    0.090448] Reserving 256MB of memory at 2816MB for crashkernel (System RAM: 4095MB)

so that can also explain the difference between one and the other, since Ubuntu doesn’t have that. In fact, if you take the Ubuntu value, and minus the Rocky value, you get approx 256MB so confirms what I wrote.

I also see figures like this on RHEL9.x running on vmware. It must be reserved for (something like) crashkernel.

Thank you for the explanation. I used grubby to disable the kernel crash dump and now its showing the same amount as in ubuntu.

1 Like