Or simply disable swap if you have enough RAM. I've been running without swap since 2014 on a 16 GB laptop. I upgraded to 32 GB a couple of years later when I started to routinely use at least 12 GB. At least one browser and editor window per virtual desktop (one VD per customer plus a couple for me), docker, virtualbox, slack, thunderbird, etc.