3 ms·
Doesn't KVM work that way? You can give a VM "up to" a certain amount of memory but it doesn't allocate all that memory at first boot. iiuc that's because each
by suprjami 3y ago
Doesn't KVM work that way? You can give a VM "up to" a certain amount of memory but it doesn't allocate all that memory at first boot. iiuc that's because each VM is just a process which can increase its own heap.
It's explained in more detail here: https://serverfault.com/questions/773581/virt-manager-partioning-the-available-memory https://serverfault.com/questions/773581/virt-manager-partio...
- rwmj 3y agoNot really, no. The kernel has a certain overhead tracking pages and page tables, so adding extra memory and waiting for it to be swapped in isn't free. Plus you still have to account for the memory being used somehow. If you use cgroups - as is done most commonly - that will track the full memory allocated. Not to mention this would only solve half of the problem, you also have to think about what happens with munmap.
- suprjami 3y agoGood points, thank you for the explanation!