[libvirt] Memory

Ryota Ozaki ozaki.ryota at gmail.com
Sat Jul 17 11:49:58 UTC 2010


Hi Jaromír
2010/7/17 Jaromír Červenka <cervajz at cervajz.com>:
> Hello,
> Could anybody explain me a little bit what is the difference between
> <currentMemory> and <maxMemory>. I use qemu-kvm hypervisor. When I have
> 1024MB maxMemory and 512MB of currentMemory, I can see just 512MB in guest
> os (free -m). Is it ok? Does it have something to do with ballooning
> technique? What happened if guest will needs more memory than 512MB?

In qemu-kvm case, currentMemory means actual amount of memory (or initial amount
of memory) which you allow the guest to use and maxMemory means the maximum
amount of memory which you (or admin) can increase up to, through libvirt.

With your setting, libvirt launches the VM with 1024MB memory and then reduces
the amount of memory down to 512MB through balloon driver. So 512MB which
you're seeing in the guest is correct and expected. Because the rest
of the memory
has been reclaimed by the hypervisor, the guest cannot gain more memory than
512MB. The answer for the question--what happened?--is that the guest OS will
behave as same as when it has just 512MB memory and gets memory pressure,
i.e., reclaim memory, do swapping, or something.

If you want to allow the guest to gain more memory, at first you need
to increase
the amount of guest memory through the balloon driver (you know you can change
the amount up to maxMemory at maximum). You can use virsh setmem for that.

  ozaki-r

> Thank you for answers :)
> Kind regards,
>
> Jaromír Červenka
> Official openSUSE community member
> Web: http://www.cervajz.com/
> Jabber: cervajz at cervajz.com
> MSN: jara.cervenka at seznam.cz
> Tel.: +420 607 592 687
> Alt. e-mails:
> jaromir.cervenka at opensuse.org,
> jaromir.cervenka at speel.cz
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>




More information about the libvir-list mailing list