Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


KVM guest eat up memory and do not release
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

KVM guest eat up memory and do not release

jaxyanjaxyan Member
edited October 2012 in General

Hi,

I am confused and curious that,
After I test my hdd performance with dd in KVM guest,
I found the memory used do not release.

Is there any problem i set the KVM host wrong?

Any help would be appreciated.

Regards,
Jasper

Comments

  • [update]
    after i tried echo 3 > /proc/sys/vm/drop_caches
    the memory release.
    so i gonna be a cache issue.

    but i found rare that i have to do it manually to release the cache.
    and have to do twice on host and guest

    any help?

  • 1) What guest disk cache method are you using?
    2) What control panel are you running? (SolusVM?)
    3) If its SolusVM and CentOS 6, turn of traffic shaping and IP stealing/ARP (Causes memory leaks)

    4) KVM Can and will eat up free memory, just like a normal system, to improve performance.

    Overselling RAM on KVM is pretty pointless because of this, as its almost impossible when compared to OpenVZ.

  • i just play around a kvm host and guest system in my test pc.

    even when i create the guest disk image(raw) with cache='none' have no effect.
    sounds rare.

  • MaouniqueMaounique Host Rep, Veteran

    cache='none' has no effect on how the guest ram is used.
    Linux does use memory, issue the free -m command and you will see the real usage.
    M

  • the most rare things was that the used memory was not a process(s) but in the cache as refer to the top command.

  • @jaxyan said: the most rare things was that the used memory was not a process(s) but in the cache as refer to the top command.

    That's not rare, that's how memory management in linux is. The memory is cached (saved) so that future executions (in this case read/writes) don't have to start all over again from nothing. It will get released if another program needs it, you can test this easily. Check the output of free -m as said above.

  • rm_rm_ IPv6 Advocate, Veteran

    The guest just uses all free RAM for something useful (i.e. the disk cache). It does not see any need to release it back to being free, better keep some disk cache around to increase performance. Of course on the host this translates into guest using up RAM to it's allowance and not releasing any. What else would you expect.

  • but that means,

    for example, i set a guest with 2g memory.
    while i try dd to test hdd performance.
    the memory was used almost 2g and made cached.
    the all usable memory was almost gone but will not be released after complete executing the dd command.

    as a result, i found no usable memory.

    almost 2g out of 2g usable memory has been used but won't get back until rebooting.

  • here are the top result after executing dd.

    top - 09:28:30 up 15:34, 1 user, load average: 0.00, 0.00, 0.00
    Tasks: 53 total, 1 running, 52 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 2061228k total, 2045364k used, 15864k free, 4544k buffers
    Swap: 562164k total, 0k used, 562164k free, 1957164k cached

  • start KSM if it's still off and check again

  • @jaxyan start a program now, you'll see cached decrease and you shouldn't delve into swap.

Sign In or Register to comment.