Why Does AWS Instance Always Lost Around 500MB Memory

Home » CentOS-Virt » Why Does AWS Instance Always Lost Around 500MB Memory
CentOS-Virt 2 Comments

Hi,

I launched an AWS instance `t2.medium` (use CentOS 7 image “ami-7abd0209”, product code: https://aws.amazon.com/marketplace/pp/B00O7WM7QW), which is supposed to have 4GB Memory in total, but turn out it is only “3.5GB”.

“`
$ free -h
total used free shared buff/cache available Mem: 3.5G 441M 1.4G 16M 1.6G
2.7G
Swap: 0B 0B 0B
“`

It does not happen to AWS Ubuntu 16.04.

“`
$ free -h
total used free shared buff/cache available Mem: 3.9G 49M 3.3G 5.5M 518M
3.7G
Swap: 0B 0B 0B
“`

This seems to happen to all AWS CentOS image, regardless which instance type it is.

2 thoughts on - Why Does AWS Instance Always Lost Around 500MB Memory

  • A rough guess would be that the system has reserved some memory for crashkernel but that is a guess. I would look at /proc/commandline to see what the kernel is starting up with.


    Stephen J Smoogen.

  • Hi Stephen,

    I’ve just tested in Virtualbox, same thing happened to CentOS but the loss is lesser than in AWS.

    Both machines are allocated with 4096MB in Vagrantfile.

    “`
    [vagrant@my-multi-CentOS-72 ~]$ cat /proc/meminfo MemTotal: 3882384 kB
    MemFree: 3527648 kB

    vagrant@my-multi-ubuntu-1604:~$ cat /proc/meminfo MemTotal: 4046708 kB
    MemFree: 3695204 kB
    “`

LEAVE A COMMENT