georgemk - I've not seen anything of what OS you're on, but if you're on Windows, check out
RAMMap.
There was (or is, not sure if it was ever fixed) a particularly nasty glitch in Windows 10 where the standby memory cache fills up and then never releases - so even though the task manager shows you have a ton of memory free it's not actually
available.
RAMMap also lets you check page tables to see how much a specific process is being paged out. Even if your swap file's on an SSD, it's less efficient than leaving it in RAM.