qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Memory: how to determine the max memory size of one VM?


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] Memory: how to determine the max memory size of one VM?
Date: Fri, 10 Feb 2012 10:35:46 +0000

On Fri, Feb 10, 2012 at 9:47 AM, Zhi Yong Wu <address@hidden> wrote:
> Today i tried to create one VM with the option "-m 4000", and found it
> failed with the following errors:
>
> Failed to allocate 4194304000 B: Cannot allocate memory
> Aborted (core dumped)

Did you run on a 32-bit host?

> I checked the qemu code, and found that in qemu_memalign() function,
> posix_memalign() failed to allocate requested memory. Perhaps due to
> No enough memory.
>
> But when i tried with "-m 3000", it can work.
>
> So i have one question about this. How to determine the supported max
> memory size of one VM on one specifc host?

Since QEMU may use host virtual memory for guest RAM the limit isn't a
hard limit that is easy to describe.  If the host OS performs memory
overcommit by default (i.e. will allow processes to map memory without
dedicating that amount of swap), then you can theoretically allocate
up to your address space limit (32-bit or 64-bit) and won't get error
until you begin dirtying more host pages than the host has resources
for.

But normally for KVM you want sum(vms) < host_ram, unless you are
betting on KSM to deduplicate guest memory.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]