All of lore.kernel.org
 help / color / mirror / Atom feed
From: rek2 <rek2@binaryfreedom.info>
To: tfjellstrom@shaw.ca
Cc: kvm@vger.kernel.org, Avi Kivity <avi@redhat.com>
Subject: Re: Memory under KVM?
Date: Sun, 13 Dec 2009 15:23:33 -0500	[thread overview]
Message-ID: <4B254D45.40600@binaryfreedom.info> (raw)
In-Reply-To: <200912130941.47737.tfjellstrom@shaw.ca>

Hi Thanks for the responses, but look:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 
/usr/bin/kvm -S -M pc-0.11 -m 1024 -smp 1 -name vm_hsci -uuid 
52ed4c7c-65e4-325e-0f96-87a5be6d854c -monitor 
unix:/var/run/libvirt/qemu/vm_hsci.monitor,server,nowait -boot c -drive 
file=/var/kvm_images/vm_hsci.img,if=virtio,index=0,boot=on -net 
nic,macaddr=00:16:36:5b:c4:e2,vlan=0,name=nic.0 -net 
tap,fd=16,vlan=0,name=tap.0 -serial pty -parallel none -usb -vnc 
127.0.0.1:0 -k en-us -vga cirrus -soundhw es1370

I have -m 1ith 1024 right?
but if I do a top:
1214m 364m 3360 S    0  4.5  46:55.24 kvm

so is clearly above -m
what could be the issue?
Thanks


is using 1214 at this moment sometimes it goes up a lot more..




On 12/13/09 11:41 AM, Thomas Fjellstrom wrote:
> On Sun December 13 2009, Avi Kivity wrote:
>    
>> On 12/12/2009 10:37 PM, Thomas Fjellstrom wrote:
>>      
>>> I have the opposite happen, when a VM is started, RES is usually lower
>>> than -m, which I find slightly odd. But makes sense if qemu/kvm don't
>>> actually allocate memory from the host till its requested the first
>>> time
>>>        
>> That is the case.
>>
>>      
>>> (if only it
>>> would return some of it afterwards, it would be even better).
>>>        
>> Use the balloon driver to return memory to the host.
>>      
> Will it actually just free the memory and leave the total memory size in the
> VM alone? Last I checked it would just decrease the total memory size, which
> isn't that useful. Sometimes it needs more ram, so its given 512M ram, but
> most of the time can live on 100M or so.
>
>    
>>> I just fully shut down and restarted on of my vms, which is set to use
>>> 128-256 MB ram max. RES is like 72MB on start, and VIRT is 454M. RES
>>> generally gets up around 120MB ram when its doing something.
>>>
>>> One thing I do find a little odd is one of my VMs which is allocated
>>> 512MB ram, has a VIRT of 826MB ram. I didn't realize that qemu had so
>>> many lib dependencies.
>>>        
>> It's not just libraries, it's mostly glibc malloc() allocating huge
>> pools per thread, as well as large thread stacks.
>>
>>      
>>> Due to kvm not supporting giving memory back, besides by
>>> swapping large portions of unused guest ram, my host currently has over
>>> 1G used swap. Not particularly happy with that, but it doesn't seem to
>>> effect performance too much (except that it generally likes to swap
>>> host processes first, guest performance is decent, but host, not so
>>> much).
>>>        
>> The Linux vm prefers anonymous memory, so guests do get an advantage.
>>
>>      
> I think the only thing I'd like to have now is automatic memory return, much
> like vmware server has. It doesn't change what the guest VM sees, it just
> flushes the unused ram back to the host.
>
>    


  parent reply	other threads:[~2009-12-13 20:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-11 21:43 Memory under KVM? rek2
2009-12-11 22:54 ` Brian Jackson
2009-12-12  8:09 ` Avi Kivity
2009-12-12 20:37   ` Thomas Fjellstrom
2009-12-13 10:08     ` Avi Kivity
2009-12-13 16:41       ` Thomas Fjellstrom
2009-12-13 16:45         ` Avi Kivity
2009-12-13 17:16           ` Thomas Fjellstrom
2009-12-15 10:06             ` Avi Kivity
2009-12-15 23:21               ` Thomas Fjellstrom
2009-12-16  9:55                 ` Avi Kivity
2009-12-16  9:58                   ` Thomas Fjellstrom
2009-12-16 10:00                     ` Avi Kivity
2009-12-16 10:09                       ` Thomas Fjellstrom
2009-12-13 20:23         ` rek2 [this message]
2009-12-13 21:42           ` Thomas Fjellstrom
2009-12-13 22:06             ` rek2
2009-12-14 15:50             ` rek2
2009-12-14 19:57               ` Thomas Fjellstrom
2009-12-15 10:07               ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2009-12-10 22:10 Christian Fernandez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B254D45.40600@binaryfreedom.info \
    --to=rek2@binaryfreedom.info \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=tfjellstrom@shaw.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.