On Linux, how can I reset the freed pages of memory to reduce the size of the virtual machine snapshots?
Unusual memory is saved in the picture, even if this memory has been freed and is no longer used. For example, memory pages freed from the file system cache with
sync && echo 3 > /proc/sys/vm/drop_caches
uselessly stored in the snapshot because they were not reset to zero.
Update . A really terrible solution that seems to work is malloc + memset memory in a loop until it hits the OOM killer. This reduces the size of a single VM snapshot, which I tested from about 800 MB to about 400MB. Is there a better solution?
linux virtual-machine linux-kernel
felix
source share