Discussion:
[vbox-dev] reducing state-file size (and the time to create it)
Petar Bogdanovic
2014-04-12 15:06:52 UTC
Permalink
Hi,

VirtualBox seems to be very efficient when saving the contents of a VM's
memory. If your VM just booted, saving its state will take less than a
second, while saving a VM that, for example, has been fetching many
things over NFS (and therefore has full caches claimed by the OS) will
take its time because almost all $memsize has to be written down.

How does VB know what parts of memory have to be saved and is there a
way to influence this by some trivial action inside of the VM?

Thanks,

Petar Bogdanovic
Klaus Espenlaub
2014-04-14 15:59:20 UTC
Permalink
Hi Petar,
Post by Petar Bogdanovic
Hi,
VirtualBox seems to be very efficient when saving the contents of a VM's
memory. If your VM just booted, saving its state will take less than a
second, while saving a VM that, for example, has been fetching many
things over NFS (and therefore has full caches claimed by the OS) will
take its time because almost all $memsize has to be written down.
How does VB know what parts of memory have to be saved and is there a
way to influence this by some trivial action inside of the VM?
It's using information from the lazy VM memory allocation mechanism. At
VM start, there's no backing allocated for the VM's RAM, it's allocated
as the VM writes to it. This decreases VM startup time and helps a tiny
bit with saving the VM state if the latter is done early.

With a decent OS all memory is quickly in use (and this won't change
usually), so we couldn't see any use case for influencing this from
inside the VM.

Klaus
Post by Petar Bogdanovic
Thanks,
Petar Bogdanovic
Loading...