How to force an AppVM to take more RAM

How can I force an AppVM in QubesOS to use more RAM (without restarting it)?

One of my sys AppVMs usually has very low RAM requirements. It’s configured to start with just 400 MB of RAM. Well, I needed to do an uncommon task in this VM, which resulted in the task being killed by OOM every time I attempt it. See below dmesg output

[ 1677.376157] Out of memory: Killed process 2662 (cryptsetup) total-vm:364124kB, anon-rss:157460kB, file-rss:16508kB, shmem-rss:0kB, UID:0 pgtables:388kB oom_score_adj:0

I opened the Qube Manager window and changed the VM’s settings from 400 MB of RAM to 6000 MB of RAM, and clicked “apply”, but retrying the same command over-and-over still results in it getting killed due to OOM.

The AppVM in question is using the fedora-34 TemplateVM that ships with Qubes v4.1.2.

I have 20G of unused RAM on this system. How can I force the VM to take another few gigs of RAM without having to restart it?

Maybe you can use xl mem-set and xl mem-max, but the xen documentation says the guest OS isn’t notified about the change to mem-max beyond the inital maximum, without memory hotplug being enabled for the guest OS.