As disabling swap and/or compressing memory is not recommended and also not a stable option after 10.9 Mavericks (despite the vm setting exists), I'm doomed after few days of running my Mac with my memory writing to the far-from-optimal pages of memory. As everything gets to swap or compressed memory so easily, I need to reboot my system relatively often (despite my 16GB RAM).
I'm searching for a solution which saves me from these slowdowns.
For example in Linux zramswap is optional. Also Linux has its swappiness value between 0 and 100 variable like
vm.swappiness=5
Also I may consider a solution about file cache (which usually randomly eats up tons of memory for no valid reason and fails to drop it before RAM turns to the less optimal purgatories of compressed memory and swap). For example here ZFS has an option on FreeBSD to maximize the size of file cache in memory:
vfs.zfs.arc_max="1536M"
In macOS the best known workaround for the file cache issue is running
# /usr/sbin/purge
Which is even "cronnable". So this flushes file cache, but unlikely to be optimal. It flushes too many things. Also if something is already in swap and/or compressed memory, despite the purge it stays there, so those softwares using them stay slow (and I feel that slowness, trust me).
Is there any solution to make macOS less likely to use file cache, compressed memory or swap (but still keep the first for performance and the latter two for emergency)?