Results 1 to 7 of 7

Thread: KVM Guest actual memory ~2% less than given maxmem.

  1. #1
    Join Date
    Nov 2005
    Location
    Athens,Greece-Oslo,Norway
    Beans
    366
    Distro
    Kubuntu

    KVM Guest actual memory ~2% less than given maxmem.

    Hello,

    I realized that when I create KVM virtual machines, they end up having approximately ~2% less memory than the actual max memory given.

    For example if I set the max and current memory of a VM to 1024MB of RAM, if I boot it up it will have 997MB of RAM

    Code:
    virsh setmaxmem --kilobytes 1048576 VM_Name
    virsh setmem --current --kilobytes 1048576 VM_Name
    For 2048MB it will actually have 2007MB and for 10240MB, 10021MB respectively.

    Anyone knows why?
    I made some research but I couldn't find an explanation to this.

  2. #2
    Join Date
    Jan 2009
    Location
    Seoul, Korea
    Beans
    5
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: KVM Guest actual memory ~2% less than given maxmem.

    Any ideas with this question?

    I'm also facing similar problem. I Can live with it, but some people complains with the absent memory.

    In my case, a VM instance is assigned 8GB of memory, but checking it with top command in the guest os shows 7.7GB.

  3. #3
    Join Date
    Nov 2005
    Location
    Athens,Greece-Oslo,Norway
    Beans
    366
    Distro
    Kubuntu

    Re: KVM Guest actual memory ~2% less than given maxmem.

    Quote Originally Posted by Alex.Han View Post
    Any ideas with this question?

    I'm also facing similar problem. I Can live with it, but some people complains with the absent memory.

    In my case, a VM instance is assigned 8GB of memory, but checking it with top command in the guest os shows 7.7GB.
    This is some memory overhead introduced by the Hypervisor to handle the virtual machines, and to let memory overcommitment and dynamic allocation methods like ballooning and shared memory work. It has to do with the internal datastructures of the hypervisor.

    I was writing a master thesis and I had to use virtualization when I asked this question but haven't looked deep into many details for the overhead reasons as this is another topic itself
    Last edited by CyberAngel; February 5th, 2013 at 01:38 AM. Reason: Improved the answer a little bit.

  4. #4
    Join Date
    Jan 2009
    Location
    Seoul, Korea
    Beans
    5
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: KVM Guest actual memory ~2% less than given maxmem.

    Thanks, @CyberAngel

    But can you provide me some link stuff so that I can read and understand the reason why that particular memory gap exists?

  5. #5
    Join Date
    Nov 2005
    Location
    Athens,Greece-Oslo,Norway
    Beans
    366
    Distro
    Kubuntu

    Re: KVM Guest actual memory ~2% less than given maxmem.

    Quote Originally Posted by Alex.Han View Post
    Thanks, @CyberAngel

    But can you provide me some link stuff so that I can read and understand the reason why that particular memory gap exists?
    Make a generic search for virtualization overhead and not only for "memory overhead". You will get many more results on explaining why virtualization has overhead.

    I haven't found so many papers addressing the memory overhead clearly but if you read this one it's explaining how VMware hypervisor deals with memory:
    http://www.vmware.com/files/pdf/perf...management.pdf

    This link also has an interesting discussion:
    http://communities.vmware.com/message/1994605

    A few more quick links:
    http://www.vkernel.com/files/docs/wh...iderations.pdf
    http://homepages.dcc.ufmg.br/~fabric...load/ccc07.pdf

  6. #6
    Join Date
    Jan 2009
    Location
    Seoul, Korea
    Beans
    5
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: KVM Guest actual memory ~2% less than given maxmem.

    Thanks a lot, CyberAngel.

  7. #7
    Join Date
    Feb 2008
    Location
    Texas
    Beans
    29,809
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: KVM Guest actual memory ~2% less than given maxmem.

    Thanks for sharing and please do not post in threads that have not had activity for a year or longer, since this is an old thread it has been closed.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •