How to debug openhab CPU and RAM problems on Proxmox with openhabian?

I have been having a problem with my openHab setup for some quite time now (1 year plus). I can’t remember when it started but my previous attempts to solve it have gotten me nowhere.

Basically the problem is that the openHab process uses a lot of CPU after a certain time and also the RAM memory goes up.

My setup runs on an Intel Nuc with Proxmox, VM with Debian and openhabian + mosquitto + influx.

After rebooting the system is usually at 1% CPU utilization. Then at some point and for no apparent reason, the system ends up at 70-80% CPU utilization and can only be calmed down again by a reboot. All rules and automations are still working.

I have already switched hardware from native Debian to Intel Nuc with Proxmox. The problem moves with it. So it seems to be somehow due to my model / setup, which I took with me via Backup & Restore.

Here are a few screenshots:


The spikes are openhab with high CPU load. At the lows the same openhab is also running.

Can you give me tips on how I can check or debug Openhab subprocesses more precisely? Maybe it is due to some open sessions problems or the persistence. I have not been able to find a source so far.

A gut feeling tells me that it might have soming to do with remote access through myopenhab…

There seems to be a ton of openhab processes that have been started in last 2 weeks. After killing PID 167, openhab started again as PID 316099:

I doubt that is the source, but it’s easy enough to test. Uninstall the cloud connector add-on and see if the problem returns.

What do you see in the logs when the CPU is spiked like that?

Do you have long running rules, rules with busy wait loops, rules that spawn lots of timers?

OpenHab logs show nothing interresting.
I do not have any long running rules with lots of timers or wait loops.

So I started with uninstalling the cloud connector.
First thing I noticed: I often had “communication error” boxes when I openend openhab ui on mobile phone browser and on the ios app (configured local and remote url). These errors are gone on local network since I unistalled the cloud connector.

About the CPU Load I need to wait some more days.