Re: qemu/kvm memory allocation

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

 



Il 04/07/2014 16:49, Alexei Fedotov ha scritto:
Hi engineers,

Could anyone direct me where memory allocation [1] for a new virtual
machine takes place in the code? I want to understand why the memory
is initialized with zeroes when I call malloc in a virtual machine.

Nowhere in KVM.

Memory allocation happens in userspace, which usually (but not necessarily) means QEMU. Quoting from the wiki page you mentioned:

The qemu/kvm process runs mostly like a normal Linux program. It
allocates its memory with normal malloc() or mmap() calls. If a guest is
going to have 1GB of physical memory, qemu/kvm will effectively do a
malloc(1<<30), allocating 1GB of host virtual space. However, just like
a normal program doing a malloc(), there is no actual physical memory
allocated at the time of the malloc(). It will not be actually allocated
until the first time it is touched.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux