Virtual memory was broken on my Mac (cMP 5.1) for several months, with Sierra, High Sierra, and Mojave. Apple support was useless.
I finally figured out that I was missing all the invisible partitions on the boot drive (vm, recovery, etc.). Probably a casualty of a Carbon Copy Cloner mistake. But CCC allowed me to restore the partitions from a backup.
Still, the system doesn't use the vm partition. I can get it to work manually with
sudo diskutil mount -mountPoint /private/var/vm disk1s4, but it doesn't remember this after a restart.
Any ideas on a permanent fix?