Why does free show less memory than my Linode plan?
I deployed a Nanode 1GB Linode, and the output of
free -k shows 1,014,736KB total memory. However, 1GB should be 1,048,576KB, which is less than what
free shows. Where is the rest of the memory?
Some of the total memory allotted by the Linode's plan is reserved by the system to perform low-level tasks. Here's a great discussion in the Linux codebase about reserved memory:
In the Linux system, you can review how memory is allocated and reserved - here's an example from one of my Nanodes:
# dmesg | grep "Memory: "
[ 0.000000] Memory: 993980k/1048432k available (7760k kernel code, 392k absent, 54060k reserved, 5967k data, 1984k init)
Also, memory isn't allocated in KVM as it is in a bare-metal installation. Per RedHat's documentation:
Guest virtual machines running on a KVM hypervisor do not have dedicated blocks of physical RAM assigned to them. Instead, each guest virtual machine functions as a Linux process where the host physical machine's Linux kernel allocates memory only when requested.
If you find that your Linode was not assigned the appropriate amount of memory, please reach out to our Support team for assistance.