From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: User question: balloon memory, currentMemory and Linux/FreeBSD guests Date: Wed, 21 Mar 2012 15:22:25 +0200 Message-ID: <4F69D611.6070805@redhat.com> References: <45e3fcac61fc83a88d7c2cd9865c7aee@pingnetworks.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Andy Smith Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42894 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758928Ab2CUNWb (ORCPT ); Wed, 21 Mar 2012 09:22:31 -0400 In-Reply-To: <45e3fcac61fc83a88d7c2cd9865c7aee@pingnetworks.co.uk> Sender: kvm-owner@vger.kernel.org List-ID: On 03/14/2012 01:51 PM, Andy Smith wrote: > Hi, > > I'm a KVM user, using it for the first time and so far very happy > with it. > I wonder if someone can help me get my head round the issue of balloon > memory and overallocation. > > Basically I have a Debian wheezy/sid KVM server, on which I have a > couple of Linux guests and several FreeBSD guests and I see different > behaviour between the two guest types. On FreeBSD I have installed the > virtio and balloon drivers (disk and network working great!), there is > definately a balloon process running. > The behaviour I see is that both Linux and FreeBSD guests always show > the "currentMemory" number when quiered with "qemu-monitor-command > --hmp ClientName --cmd 'info balloon'". But from a "top" in the debian > KVM host the "RES" size of the Linux guest processes varies > (presumably depending on the demand of the guest OS) but the FreeBSD > kvm processes always sit at exactly the "currentMemory" size. > > Basically I'm interested to know what is going on, whether what I see > is normal and whether balloon currently dynamically manages memory > usage or if its still the case that it requires administrator > intervention to re-release memory after the OS has previously been > allocated it. The RES column indicates how much memory guests are actively using. Linux touches memory when it first uses it, so if your guests are idle, RES will remain low. It seems FreeBSD touches memory immediately (or perhaps those guests are not idle), so it's high. RES (or rather, RSS - resident set size) can decrease when the host swaps guest pages, or if the guest gives up memory via to ballooning. -- error compiling committee.c: too many arguments to function