AppVM crashes periodically
Qubes OS release
R4.0
Brief summary
Periodically, my OS becomes very sluggish and shortly thereafter, all the apps from my "online" appVM will crash. Then I am unable to use that appVM until I reboot it.
Steps to reproduce
Use the OS normally. Notably, I have heavier applications running in this appVM than in others, such as two web browsers. Nothing that's really resource intensive, though. No games or anything of the like.
The appVM in question has a max memory of 8000 MB and 4 VCPUs. This is a Skylake i5 desktop CPU.
Expected behavior
Programs run smoothly and are stable.
Actual behavior
It does run smoothly, but suddenly it will run sluggish. Windows will hardly respond to clicks, and music playback becomes incredibly choppy. It's more apt to say the music hangs. Soon after this, all windows of the VM crash. If I run an app from this appVM with qvm-run, nothing happens. No output for the command, it just takes forever to finish. It stays this way until I reboot the appVM.
Sounds like memory swapping. Try non-dynamic memory allocation and try to disable swapping in dom0.
How much memory should I allocate to dom0, sys-net, sys-firewall, and sys-whonix? I have 32 GB RAM.