# Allocated/Real Memory

**URL:** <https://forum.opennebula.io/t/allocated-real-memory/3219>\
**Category:** Product Support\
**Created:** [November 3, 2016, 9:48am UTC](https://forum.opennebula.io/t/allocated-real-memory/3219 "2016-11-03T09:48:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![UAnton](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/uanton/32/6309_2.png) [@UAnton](https://forum.opennebula.io/u/UAnton)\
**Post date:** [November 3, 2016, 9:48am UTC](https://forum.opennebula.io/t/allocated-real-memory/3219/1 "2016-11-03T09:48:08Z")

</div>

Hello!  
Why Allocated/Real Memory every time have the same value on KVM Hypervisor? I create VM with 16G - Real/Allocated - 16GB but in VM 65MB.

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [November 4, 2016, 9:36am UTC](https://forum.opennebula.io/t/allocated-real-memory/3219/2 "2016-11-04T09:36:31Z")

</div>

Can you check that the memory value is correct in libvirt? You can retrieve this info in KB executing this command in the hypervisor host:

```nohighlight
# virsh -c qemu:///system dommemstat one-<vmid>

```

Does it happen to all the VMs or only with an specific image?

---

<div class="post-metadata">

**Author:** ![UAnton](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/uanton/32/6309_2.png) [@UAnton](https://forum.opennebula.io/u/UAnton)\
**Post date:** [November 4, 2016, 10:04am UTC](https://forum.opennebula.io/t/allocated-real-memory/3219/3 "2016-11-04T10:04:41Z")

</div>

it happen to all the VMs

virsh -c qemu:///system dommemstat one-284  
actual 16777216  
rss 799996

 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/7/7d043ff55e0245cfe2ec5f7b8f417badd3629854.png)

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [November 7, 2016, 10:25am UTC](https://forum.opennebula.io/t/allocated-real-memory/3219/4 "2016-11-07T10:25:36Z")

</div>

OpenNebula seems to be correctly setting the memory. What’s exactly the problem? The VM can not see 16 Gb of memory? If this is the problem then there should be a problem with your VM. Maybe it’s 32 bits and you need to enable PAE.

If you expect the VM to consume only allocated memory you should look into memory balloning. OpenNebula does not support it anyway.

[https://libvirt.org/formatdomain.html#elementsMemBalloon](https://libvirt.org/formatdomain.html#elementsMemBalloon)

---

<div class="post-metadata">

**Author:** ![UAnton](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/uanton/32/6309_2.png) [@UAnton](https://forum.opennebula.io/u/UAnton)\
**Post date:** [November 7, 2016, 10:33am UTC](https://forum.opennebula.io/t/allocated-real-memory/3219/5 "2016-11-07T10:33:38Z")

</div>

I meant that Opennebula shows only the allocated memory is not real …

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [November 10, 2016, 10:44am UTC](https://forum.opennebula.io/t/allocated-real-memory/3219/6 "2016-11-10T10:44:04Z")

</div>

OpenNebula queries the hypervisor to check how much memory the VM is consuming. That’s the value we use as we don’t get information from the Guest OS.

---

<div class="post-metadata">

**Author:** ![UAnton](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/uanton/32/6309_2.png) [@UAnton](https://forum.opennebula.io/u/UAnton)\
**Post date:** [May 6, 2017, 9:13pm UTC](https://forum.opennebula.io/t/allocated-real-memory/3219/7 "2017-05-06T21:13:42Z")

</div>

Hello,  
I find some sulutions about memory stat in opennebula and kvm.

> <https://stackoverflow.com/questions/27777099/how-to-get-memory-stats-of-guests-on-kvm-hosts>

  
[http://libvir-list.redhat.narkive.com/0xg544qp/libvirt-kvm-domain-memory-and-disk-usage](http://libvir-list.redhat.narkive.com/0xg544qp/libvirt-kvm-domain-memory-and-disk-usage)  
[https://www.redhat.com/archives/virt-tools-list/2015-November/msg00138.html](https://www.redhat.com/archives/virt-tools-list/2015-November/msg00138.html)

---

<div class="post-metadata">

**Author:** ![feldsam](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/feldsam/32/4441_2.png) [@feldsam](https://forum.opennebula.io/u/feldsam)\
**Post date:** [May 8, 2017, 9:20am UTC](https://forum.opennebula.io/t/allocated-real-memory/3219/8 "2017-05-08T09:20:47Z")

</div>

Hello UAnton, you can get real memory consumption from guest, but it is useless with default kvm driver.

By default, when you create new VM, driver sets “Max memory” and “Used memory” to same size. So Virtio Balloon have zero size. You can read more about ballooning [here](https://rwmj.wordpress.com/2010/07/17/virtio-balloon/)

For OpenNebula exist project called [CloudVAMP](http://www.grycap.upv.es/cloudvamp/index.php), which I personally tested and contributed to it, but don’t use it.

I don’t use it, because of problems with monitoring linux guests and swapping. Project uses simple monitoring script, which send data about free memory via OneGate to VM User template. CloudVAMP daemon reads it and adjust “Used Memory” size on the fly. Problem is with swapping, because if VM doesn’t have enough memory, it try to swap and freeze, so no new monitoring data will be send. CloudVAMP daemon needs to implement some timeout, which will be checking for last monitored time and if there is delay it should set “Used Memory” size to “Max Memory” size. I was planning to implement this, but for now I don’t have a time and/or taste to do it.

---

<div class="post-metadata">

**Author:** ![UAnton](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/uanton/32/6309_2.png) [@UAnton](https://forum.opennebula.io/u/UAnton)\
**Post date:** [May 8, 2017, 4:53pm UTC](https://forum.opennebula.io/t/allocated-real-memory/3219/9 "2017-05-08T16:53:06Z")

</div>

Hello feldsam,  
Thanks for unswer. I try.
