troubleshooting Question

hyperv centos guest consumes all memory

Avatar of Richard Frank
Richard FrankFlag for Netherlands asked on
LinuxVirtualization* CentOSHyper-V
7 Comments1 Solution452 ViewsLast Modified:
I enabled in hyper-v 2012 the use of dynamic memory for a centos vm
centos-release-6-9.el6.12.3.x86_64
I followed these guidelines https://www.altaro.com/hyper-v/centos-linux-hyper-v/
I created a file in /etc/udev/rules.d/ named 100-balloon.rules
content:
SUBSYSTEM=="memory", ACTION=="add", ATTR{state}="online"

I setup startup mem 1024, minimal memory 1024 and max 4096

unlike other centos vm's I have it starts consuming all memory
so, i gave it 8Gb .. all memory was consumed
I increased the max memory to 20Gb, and it was consumed

this is meminfo
cat /proc/meminfo
MemTotal:        1012124 kB
MemFree:          103732 kB
Buffers:           57512 kB
Cached:           270100 kB
SwapCached:            0 kB
Active:           532960 kB
Inactive:         194180 kB
Active(anon):     399540 kB
Inactive(anon):    33240 kB
Active(file):     133420 kB
Inactive(file):   160940 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       2031612 kB
SwapFree:        2031612 kB
Dirty:               124 kB
Writeback:             0 kB
AnonPages:        399552 kB
Mapped:            61676 kB
Shmem:             33252 kB
Slab:              66568 kB
SReclaimable:      33048 kB
SUnreclaim:        33520 kB
KernelStack:        7104 kB
PageTables:        13568 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2537672 kB
Committed_AS:    1654524 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       31292 kB
VmallocChunk:   34359591288 kB
HardwareCorrupted:     0 kB
AnonHugePages:     77824 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        8128 kB
DirectMap2M:     4317184 kB
top > 
top - 17:28:04 up 11 min,  1 user,  load average: 0.57, 0.40, 0.26
Tasks: 349 total,   1 running, 348 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.4%us,  0.7%sy,  2.9%ni, 95.5%id,  0.5%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1012124k total,   912916k used,    99208k free,    58476k buffers
Swap:  2031612k total,        0k used,  2031612k free,   266864k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 2305 apache    20   0  281m  98m  40m S  0.0  9.9   0:18.13 httpd
 2184 mysql     20   0 1114m  94m 6264 S  0.0  9.6   0:44.22 mysqld
 2302 apache    20   0  258m  87m  38m S  0.0  8.9   0:11.07 httpd
 2295 apache    20   0  561m  73m  37m S  0.0  7.5   0:09.10 httpd
 2298 apache    20   0  239m  63m  32m S  0.0  6.4   0:09.53 httpd
 2362 apache    20   0  312m  39m  29m S  0.0  4.0   0:10.26 httpd
 2456 apache    20   0  312m  37m  27m S  0.0  3.8   0:08.34 httpd
 2893 named     20   0  991m  32m 3056 S  0.0  3.3   0:00.50 named
 2457 apache    20   0  312m  32m  22m S  0.0  3.3   0:09.53 httpd
 2296 apache    20   0  217m  29m  19m S  0.0  2.9   0:15.26 httpd
ASKER CERTIFIED SOLUTION
David Favor
Fractional CTO
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros