In principle yes, in practice it's complicated, using something called "balloon drivers"
https://en.wikipedia.org/wiki/Memory_ballooning
There’s also memory hotplugging via virtio-mem. But generally speaking downscaling live vm memory can’t be said to be a solved problem, it’s more of an active area of research.
There’s also memory hotplugging via virtio-mem. But generally speaking downscaling live vm memory can’t be said to be a solved problem, it’s more of an active area of research.