From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: How much physical memory can be used to run domains in a KVM machine? Date: Mon, 20 Jul 2009 09:43:22 +0800 Message-ID: <200907200943.23545.sheng@linux.intel.com> References: <8b8dd4340907162250j55b6d93l4a20dc6f42c6e3a2@mail.gmail.com> <4A60257E.3060908@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: sudhir kumar , dlaor@redhat.com, Zhang Qian To: kvm@vger.kernel.org Return-path: Received: from mga12.intel.com ([143.182.124.36]:59041 "EHLO azsmga102.ch.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752306AbZGTBnm (ORCPT ); Sun, 19 Jul 2009 21:43:42 -0400 In-Reply-To: Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Friday 17 July 2009 17:56:49 sudhir kumar wrote: > On Fri, Jul 17, 2009 at 12:47 PM, Dor Laor wrote: > > On 07/17/2009 08:50 AM, Zhang Qian wrote: > >> Hi, > >> > >> I have a KVM box which has 4GB physical memory totally, I'd like to > >> know how much I can use to run my domains, and how much will be > >> reserved by hypervisor(KVM) itself? > >> Thanks! > > > > KVM and the Linux host use relatively low amount of memory. > > Unlike other hypervisors you know, kvm does not reserve memory and also > > is able to swap the guest memory, so you can even use more than 4G for > > your > > Is that true? I think we can not allocate memory more than the > physical RAM. Or does upstream kvm supports it? My kvm version is not > that old but memory allocation failed for me when I tried to give the > whole memory on my host to the guest. It's not specific to KVM. QEmu use malloc()/mmap() to allocate memory for KVM, which is controlled by Linux kernel memory overcommit policy. Linux kernel didn't support memory overcommit by default. You can refer to Document/vm/overcommit-accounting and other related document to enable it. -- regards Yang, Sheng > > > guest. (Just note swapping will be slow) > > > >> Regards, > >> Qian > >> -- > >> To unsubscribe from this list: send the line "unsubscribe kvm" in > >> the body of a message to majordomo@vger.kernel.org > >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > > > -- > > To unsubscribe from this list: send the line "unsubscribe kvm" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html