openHAB 2.4 suddenly causes high CPU load

  • Platform information:

    • Hardware: Raspberry Pi 3 Model B
    • OS: openHABianPi
    • Java Runtime Environment: openjdk version “1.8.0_152”
    • openHAB version: openHAB 2.4.0-1 (Release Build)
  • Issue of the topic: High CPU load out of “nowhere”

My openHAB installation ran smoothly for months, and suddenly it has high CPU load and I don’t know where it comes from:

(green: Temperature, yellow: load)

Load is caused by openHAB:

Karaf shell:threads --list tells me:

What’s pool-x-thread-x good for? Where have I to look for to find cause of this high CPU load?

I disabled a rule that sent a MQTT message at this time which errored last weeks (because I thought this might cause the issue):

Rule 'Transmit IR Signal': 'publishMQTT' is not a member of 'org.eclipse.smarthome.core.thing.binding.ThingActions'

and it didn’t happen again since last reboot.

I now re-enabled that rule and triggered it again - and this time it worked again. Despite not working last times I tried to fix it with restart… weird.

Anyways, it’s time to migrate to openHAB 3, hopefully this issue won’t come up again.

Sadly I’m not yet fully migrated (needs hardware changes too) and the issue happened again.

On the good side, I can correlate this to the times my computer is on too:

Yes I have some automation running when my computer is on (turn lights on, turn speakers on) but it’s all just an “on change” event once the status (ping response) of my computer changes.

I know nothing special my computer could do - Grafana and InfluxDB run on a different server, only frontail (for viewing the logs) is on the same machine and runs in background on my computer


… I finally found it digging into my network traffic. Problem was caused by Visual Studio Code OpenHAB Addon - as soon as I close Visual Studio Code, everything everntually goes back to normal.
I will post more details soon.

This is how traffic to my Raspberry Pi looked like:

This was all caused by plenty of TCP retransmissions:

I’m not yet sure what caused this - maybe putting my computer to hibernation or letting Visual Studio Code run (too) long might be an issue. At least I now know what to do when it happens.

Potentially related: I had OH2 on an RPi 3B+, and used VSC from another PC to edit configurations using the Remote SSH feature of VSC.

I found that when active I’d lose almost 400 MB of RAM on the Pi, and with only 1GB total it sometimes locked up completely when it ran out.

Interesting, yes. I edit files using default samba shares.