Stuck on 2GB memory for CentOS7 HyperV

General support questions
Post Reply
jollero
Posts: 5
Joined: 2017/11/07 08:10:13

Stuck on 2GB memory for CentOS7 HyperV

Post by jollero » 2017/11/29 02:56:32

I have a hyperV VM of CentOS7 64bit with 8GB of RAM. It's accessed via VESTA and is running a Mailwizz implementation. So I know there is a lot of services running there.

My problem is that for some reason, it cannot go beyond 2GB in memory and therefore accumulates a large swap file. I'm not sure why it's like that.

I read some forums on proper memory allocation and I was able to try to use Dynamic Memory but it only got me as far as 3GB and I still got stuck? I know I have a 64bit version of the OS installed so I don't have an idea why it can't move forward.

Any ideas on why my memory usage can't go beyond 2GB?

Thanks in advance!

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Stuck on 2GB memory for CentOS7 HyperV

Post by TrevorH » 2017/11/29 07:09:13

No, it sounds like a problem with the hypervisor to me. What is the output from uname -a on your gurst?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jollero
Posts: 5
Joined: 2017/11/07 08:10:13

Re: Stuck on 2GB memory for CentOS7 HyperV

Post by jollero » 2017/11/29 07:14:52

Here is the output:

Linux anxamobile.com 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I'd welcome any ideas. I have nowhere else to look.

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Stuck on 2GB memory for CentOS7 HyperV

Post by TrevorH » 2017/11/29 07:28:19

Well that's out of date but it's not massively out of date. I'd check your VM memory settings on the host - make sure the memory is allocated to it - ballooning does not work on guests on hyper-v.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jollero
Posts: 5
Joined: 2017/11/07 08:10:13

Re: Stuck on 2GB memory for CentOS7 HyperV

Post by jollero » 2017/11/29 07:39:45

Memory is allocated and set as 8192.

I found some ballooning articles a couple of months back. It work slightly but pegged me at 3GB. I guess it might have encountered the same problem I have right now.

Thanks for the comment. You have any more?

jollero
Posts: 5
Joined: 2017/11/07 08:10:13

Re: Stuck on 2GB memory for CentOS7 HyperV

Post by jollero » 2017/12/01 03:43:45

I have something strange but maybe it's not

Code: Select all

[root@anxamobile ~]# free
              total        used        free      shared  buff/cache   available
Mem:        8002872     2017632      282172       23216     5703068     5649928
Swap:       4063228      502492     3560736
[root@anxamobile ~]#
From what I understand, Centos7 does indeed see 8GB but says that the free memory is only 282k. The rest are considered buff/cache. I already have 4GB of swap file.

Is this right? Should I be able to utilize all 8GB as my memory and preventing a large swap file?
How can I utilize the shared buff/cache as main memory?

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Stuck on 2GB memory for CentOS7 HyperV

Post by avij » 2017/12/01 08:22:48

There's even a website dedicated to this: https://www.linuxatemyram.com/

The 4GB swap file (or partition) you have is allocated statically at boot time. The size of the swap file does not grow or shrink during usage. You are only using some 500MB of it at the moment. Perhaps the kernel decided that those bits of memory that got swapped out are not accessed often enough, and that the memory would be better used for buffers and caching. If you want to adjust how eagerly the kernel swaps to disk, there's a "swappiness" parameter (search for it on the internet for its usage) that you can tune. But unless you have an actual performance problem with how your system swaps, I'd recommend leaving that parameter alone.

Post Reply