From: Thomas Fjellstrom Subject: Re: automatic memory ballooning? Date: Mon, 17 Aug 2009 06:32:11 -0600 Message-ID: <200908170632.11428.tfjellstrom@shaw.ca> References: <200908160355.46652.tfjellstrom@shaw.ca> <200908170449.40945.tfjellstrom@shaw.ca> <4A894070.9080402@redhat.com> Reply-To: tfjellstrom@shaw.ca Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , dlaor@redhat.com To: kvm@vger.kernel.org Return-path: Received: from idcmail-mo2no.shaw.ca ([64.59.134.9]:54236 "EHLO idcmail-mo2no.shaw.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752866AbZHQMbk (ORCPT ); Mon, 17 Aug 2009 08:31:40 -0400 In-Reply-To: <4A894070.9080402@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon August 17 2009, Avi Kivity wrote: > On 08/17/2009 01:49 PM, Thomas Fjellstrom wrote: > > One thing I found odd about kvm's ballooning is that it actually seems to > > change how much ram the guest has. I really didn't expect "free -m" to > > report that the guest only had 64M ram after I manually ballooned the > > ram. I was however expecting it just to free ram it wasn't using in the > > host. To me, it just doesn't seem to be the same thing. now it'll start > > swapping at 64M ram instead of just reallocating the ram it used to have. > > You expectations aren't realistic. kvm never allocates the ram the > guest doesn't use in the first place. Really? So htop is lying to me then? I gave 1G ram to a kvm linux guest using virtio (disk, net, ballooning), and RES clearly said 1G, and VIRT actually said somewhere around 1.3 to 1.6G. It stayed that way for over a day, and the guest did nothing the entire time. I know the kernel lies a little bit about ram usage, but it seems at least with kvm, the ram is in use when it says it is, while with vmware, it usually isn't. > Ballooning just the "free" > memory is pointless since it's usually a very small amount. > It may be worthwhile for the guest to give up that memory voluntarily > though. -- Thomas Fjellstrom tfjellstrom@shaw.ca