Huge RAM overhead needed to hibernate host with running VMs

Discussions related to using VirtualBox on Linux hosts.
Post Reply
HulkySulky
Posts: 29
Joined: 28. Jan 2020, 06:24

Huge RAM overhead needed to hibernate host with running VMs

Post by HulkySulky »

HOST : VB 6.1.36 / Debian 11.4 / Gnome 3.38
GUEST : ANY (same behavior, whether Linux or Windows)

I have a laptop with 16GiB RAM, and 24GiB swap space. I just did some extensive tests, and noticed that hibernation doesn't work when :
  • VMs are running
    AND the host's RAM usage exceeds 50%
    AND most of the host's RAM usage is due to the VMs.
Luckily there's no crash, both host and guests keep working, it just doesn't hibernate

My tests (100% reproducible, I tried 3 times, always the same behavior) :

1°/ I tested without VMs, just to make sure hibernation works. Laptop's RAM at 80%, hibernates fine.
2°/ Start VM, host's RAM a little under 50%, hibernation works fine
3°/ Open some browser tabs in VM, in order to increase RAM usage, host's RAM around 60%, hibernation fails
4°/ Pause running VM to eliminate a possible interference because it's running, but same thing, hibernation fails.
5°/ Stop and start VM (in order to free host's RAM), back to scenario 2 (VM running, less than 50% RAM on host, hibernation works)
 Edit:  Another very interesting test :
6°/ Start VM, host's RAM a little under 50%, hibernation works fine
7°/ Open some browser tabs in host, host's RAM around 80%, hibernation works fine
 Edit:  Did the same tests with Windows guests, just to be sure. Same results.

So basically :
  • when a VM is running (even paused) and it uses a certain amount or RAM, the host doesn't hibernate even though its total RAM usage is only around 60%
    when a VM is running, but uses less RAM, the host does hibernate, even if the host itself uses a lot of RAM (80%)
So it's only the RAM used by the VM that causes problems with hibernation

Again, swap space is plenty (24GiB), and it's not a Gnome problem (hibernates fine even with 80% RAM consumption when no VM is running or VM is running with little RAM used).

Does anybody have a clue ? 
 
Post Reply