Troubleshooting high resource use

I use on a vitrual machine running ubuntu (on a server 2016 install). It has worked fine before, but the latter weeks it has started running sluggish after just a few days. It can take 5 seconds for things to happen if i for instance press a button, and the problem is on the HA-side. On the ubuntu-machine, i see python3 using 2 GB of memory. I haven’t done much to the config lately. Any good way to troubleshoot what is causing problems? I run 102.1 at the moment.