This needs to be said - upgrade your RAM. If your device doesn't support a memory upgrade, get one that does.
Upgrading my laptop to 32GB RAM was one of those things where you wish you had done it a lot earlier. No more OOM-killers, no more things grinding to a halt because the box is swapping (in fact, I disabled swap altogether), no more checking memory utilisation before starting a beefy VM.
Just smooth sailing all along.