CentOS reporting lower total memory compared others in AWS

General support questions
don-code
Posts: 4
Joined: 2016/08/09 21:21:52

Re: CentOS reporting lower total memory compared others in AWS

Post by don-code » 2016/08/10 19:07:48

It doesn't look like any lazy allocation is taking place. I allocated up to around the reported limit:

Code: Select all

[centos@ip-10-175-70-15 ~]$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3695        3538          98          16          57          24
Swap:             0           0           0
...then tried to run something:

Code: Select all

[centos@ip-10-175-70-15 ~]$ sudo yum update
sudo: unable to fork: Cannot allocate memory
The system's still stuck at 3695m following this.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: CentOS reporting lower total memory compared others in AWS

Post by aks » 2016/08/11 16:21:00

I suggest you open a ticket with AWS. They are notoriously quite about the technology. All we know is that it's some sort of variation of XEN.
Those machine specs. form a contract between you and Amazon (and that's their words, especially around the charging bit).
Please post back, I'd like to know the answer.

don-code
Posts: 4
Joined: 2016/08/09 21:21:52

Re: CentOS reporting lower total memory compared others in AWS

Post by don-code » 2016/08/11 17:03:57

I did open a ticket with AWS (the response to which actually linked this thread), and noted that the same behavior is seen in the latest RHEL 7 as well. The suggestion I got was to either continue using CentOS 6, or switch to Amazon Linux, which isn't affected by the issue. Some feedback I got from the ticket:

On CentOS 6:

Code: Select all

$ cat /proc/meminfo
MemTotal: 3921016 kB
$ uname -a 
Linux ip-172-31-42-210 2.6.32-573.18.1.el6.x86_64 #1 SMP Tue Feb 9 22:46:17 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ dmesg|grep Memory:
[ 0.000000] Memory: 3843956k/4456448k available (6440k kernel code, 262540k absent, 349952k reserved, 4266k data, 1620k init)
On CentOS 7:

Code: Select all

$ cat /proc/meminfo
MemTotal: 3619008 kB
$ uname -a
Linux ip-172-31-45-176 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ dmesg|grep Memory:
Memory: 3902744k/4456448k available (5397k kernel code, 262540k absent, 291164k reserved, 7011k data, 1296k init)
On RHEL 7:

Code: Select all

$ cat /proc/meminfo
MemTotal: 3619008 kB
$ uname -a Linux ip-172-31-44-191.us-west-2.compute.internal 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
$ dmesg|grep Memory:
[ 0.000000] Memory: 3844620k/4456448k available (6440k kernel code, 262540k absent, 349288k reserved, 4266k data, 1620k init)
On the latest Amazon Linux:

Code: Select all

$ cat /proc/meminfo
MemTotal: 4049876 kB
$ uname -a Linux ip-172-31-47-30 4.4.11-23.53.amzn1.x86_64 #1 SMP Wed Jun 1 22:22:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ dmesg|grep Memory:
[ 0.000000] Memory: 4032704K/4193908K available (4999K kernel code, 983K rwdata, 2432K rodata, 1188K init, 1580K bss, 161204K reserved, 0K cma-reserved)
I'd also been wondering if Xen was somehow to blame, but given that the BIOS memory map shows the full 4GB, I'd assume it's something on the CentOS side that's allocating it away from userspace. I don't see that happening in /proc/iomem though.

Rudigern
Posts: 4
Joined: 2016/04/09 20:28:30

Re: CentOS reporting lower total memory compared others in AWS

Post by Rudigern » 2016/08/11 20:57:17

When I was testing various configs I launched about 20 VMs, I do believe with RHEL 7 at the time I was getting a reliable amount of RAM however with Centos 7 it would fluctuate with each VM made (restarting didn't affect it). It was only in the order of KB but very odd.

jtwang
Posts: 1
Joined: 2017/05/24 15:04:11

Re: CentOS reporting lower total memory compared others in AWS

Post by jtwang » 2017/05/24 16:21:03

Bump... any updates on this? I am also seeing this behavior.

On a t2.medium instance:

Code: Select all

$ dmesg | grep Memory
[    0.000000] Memory: 3840568k/4456448k available (6765k kernel code, 262540k absent, 353340k reserved, 4432k data, 1680k init)

$ cat /proc/iomem
00000000-00000fff : reserved
00001000-0009dfff : System RAM
0009e000-0009ffff : reserved
000a0000-000bffff : PCI Bus 0000:00   
000c0000-000c8bff : Video ROM
000e0000-000fffff : reserved
  000f0000-000fffff : System ROM
00100000-efffffff : System RAM
  01000000-0169b650 : Kernel code
  0169b651-01aef67f : Kernel data
  01c9d000-01f9cfff : Kernel bss
  29000000-330fffff : System RAM
f0000000-fbffffff : PCI Bus 0000:00   
  f0000000-f1ffffff : 0000:00:02.0
    f0000000-f1ffffff : cirrusdrmfb_vram
  f2000000-f2ffffff : 0000:00:03.0
    f2000000-f2ffffff : xen-platform-pci
  f3000000-f3000fff : 0000:00:02.0
    f3000000-f3000fff : cirrusdrmfb_mmio
fc000000-ffffffff : reserved
  fec00000-fec003ff : IOAPIC 0
  fed00000-fed003ff : HPET 0
    fed00000-fed003ff : PNP0103:00
  fee00000-fee00fff : Local APIC
100000000-10fffffff : System RAM
On a t2.micro instance:

Code: Select all

[    0.000000] Memory: 968532k/1048576k available (6767k kernel code, 396k absent, 79648k reserved, 4430k data, 1680k init)

harold_sun
Posts: 1
Joined: 2017/08/18 01:12:20

Re: CentOS reporting lower total memory compared others in AWS

Post by harold_sun » 2017/08/18 01:16:16

I had the same issue. After install kernel-lt or kernel-ml, the issue went away. I guess this is caused by some configuration in the stock kernel shipped with Centos 7.

Post Reply