Debugging random slowdowns and system freezes on an RPi3B

If memory is an issue, increasing the swap file size might help:

Github issue: how can i increase my swap file size? #968

There’s also a thread on how to make the change survive system reboots.

Incidentally, I should add that you can monitor some of this stuff via the System Monitor platform. No need for an additional addon that might also be contributing to the memory issues!