OH going to 100% (or greater) and not responding

  • Platform information:
    • Hardware: RPi3B
    • OS: openhabian
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 2.3.0-1

Hi All,
I have been running OH and in particular this version, for >1yr.
In the past few weeks, it goes unresponsive e.g. the Android app is unable to connect or the web interface on the PC does not come up.
If I connect with Putty and run TOP, OH is using at least 100% CPU and 40% memory. So obviously the operating system is still running.
Looking at the logs, it appears that Java has run out of memory.

Why would this all of a sudden happen?

You are likely the only one here running a version that old. There were likely big changes between 2.3 and 2.4. There were major architectural changes between 2.4 and 2.5. I doubt many here can offer much assistance other than upgrading OpenHAB.

Hi @Bruce_Osborne,
The upgrade is on my to do list but I’m hesitant due to the large change over of my MQTT devices. I still run the OLD style of MQTT items etc. I haven’t got my head around “Things” etc and how to change all of these over.
What do I hard code (like the items file) and what do I set up via the paper interface???

Example of some of the MQTT items:

// ======================================================================

Switch Tasmota_8168_GPO "Old Rear Garden Lights" <switch> (gGPO,gGardenLights,gLight) 

    { mqtt=">[mqtt_server:cmnd/Tasmota-8168-GPO/POWER1:command:*:default],

            <[mqtt_server:stat/Tasmota-8168-GPO/POWER1:state:default]" } 

// ======================================================================

Switch Tasmota_3679_GPO "Tasmota 3679 GPO" <switch> (gGPO,gLight) 

    { mqtt=">[mqtt_server:cmnd/Tasmota-3679-GPO/POWER1:command:*:default],

            <[mqtt_server:stat/Tasmota-3679-GPO/POWER1:state:default]" }            

// ======================================================================

// Carport

Switch sonoff_2410_1 "Red Lamp (GPO1)" <switch> (gGPO,gsonoff_2410_PB4USB)

    { mqtt=">[mqtt_server:cmnd/sonoff-2410-PB4USB/POWER1:command:*:default],

            <[mqtt_server:stat/sonoff-2410-PB4USB/POWER1:state:default]" }

Switch sonoff_2410_2 "Not used (GPO2)" <switch> (gGPO,gsonoff_2410_PB4USB)

    { mqtt=">[mqtt_server:cmnd/sonoff-2410-PB4USB/POWER2:command:*:default],

            <[mqtt_server:stat/sonoff-2410-PB4USB/POWER2:state:default]" }

Switch sonoff_2410_3 "Carport Rope Lights (GPO3)" <light> (gGPO,gEveningLights,gsonoff_2410_PB4USB)

    { mqtt=">[mqtt_server:cmnd/sonoff-2410-PB4USB/POWER3:command:*:default],

            <[mqtt_server:stat/sonoff-2410-PB4USB/POWER3:state:default]" }

Switch sonoff_2410_4 "Xmas Lights - Front Right (GPO4)" <light> (gGPO,gsonoff_2410_PB4USB,gChristmasLights)

    { mqtt=">[mqtt_server:cmnd/sonoff-2410-PB4USB/POWER4:command:*:default],

            <[mqtt_server:stat/sonoff-2410-PB4USB/POWER4:state:default]" }

Switch sonoff_2410_USB "Power board USB" <switch> (gGPO,gsonoff_2410_PB4USB)

    { mqtt=">[mqtt_server:cmnd/sonoff-2410-PB4USB/POWER5:command:*:default],

            <[mqtt_server:stat/sonoff-2410-PB4USB/POWER5:state:default]" }

// ======================================================================

I do not use MQTT but many people run mqtt1 with 2.5.x. The next major version OH3 could be a problem though.

Just restarted the OH service and back fully functioning at 26% CPU and 36% MEM.

This is now turning into a daily occurrence :frowning:

It’s run perfectly, untouched, for over 6 months.

Do you use the amazonechocontrol binding ?
In recent version several fixes for that binding have been implemented.
One of the changes fixes an out of memory problem which became visible due to recent changes at amazon.
The symptoms you describe match with this problem.

So upgrading to the latest 2.5 should resolve things.

Perhaps they should upgrade to 2.4 first or rebuild from scratch, based on the old configuration. Considering the version gap, the second alternative may be preferable.

@NW27 what bindings do you run? I would definitely look to an upgrade path. Here is the lathe I would most likely take.

  1. run a backup using the backup script in openHAB-cli.
  2. Build a new as card with latest version.
  3. Install the used bindings
    3a make sure openHAB starts clean with no config.
  4. Shutdown, If using paper ui manually restore the json db.
  5. Drop in config files one at a time with openHAB running. Starting with things make sure they are read with no errors.
    ** Also make sure you move the rest api in the addons.cfg if used. There is a post about updating from 2.4-2.5 on things to do.

Once you are updated we can help get mqtt converted. Loooks like you have tasmota. I can lost a thing example but there are many in forum.

If there is a post from 2.3 to 2.4 they should look at that too. That was well before my time here.

You might consider housekeeping issues - expanding databases, logfile archives. I have no particular suggestions about that, apart from figuring out what exactly is hogging your resources.

1 Like

Just something simple. If the filesystem filling up with log files?

OpenHABian that old would be running an outdated OS on a Pi too. The OS had a major update last year.

The 1.x binding is still compatible with OH 2.5.7 and I believe you can run both the 1.x and 2.x versions at the same time. So you don’t have to switch everything over all at once to upgrade. You don’t even need to switch them over at all and can continue to run 1.x. However, the 1.x binding will not be compatible with OH 3 so it would be a good idea to move over at some point. But you can go a little at a time.

The first part of MQTT 2.5 Event Bus might be useful to read.

At a very high level:

  • the stuff that goes in mqtt.cfg now goes in an MQTT Broker Thing. Manually create the MQTT Broker Thing by clicking the + icon in the Things page or Inbox page and navigate to MQTT and MQTT Broker. Fill in the connection stuff.

  • Manually create a Generic MQTT Thing and create a Switch Channel and put the cmnd topic in the command topic filed and the stat topic into the state topic field. You are not using any transformations so there is nothing else to fill in.

  • Link the Channel to a Switch Item

For the Tasmota stuff, you could also enable Home Assistant MQTT on the device in which case openHAB will automatically discover the devices and create the Things for you. Then all you need do is accept them from the inbox.

Something must have changed, an OS update, lost power resulting in file corruption, SD card wearing out, etc. Wolfgang_S is definitely right about the Amazon Control Binding. Amazon changed something on their end that broke our binding.

Between OH 2.3 and OH 3 there are several bindings that require the deletion and rediscovery of Things. I wouldn’t copy over Things and instead recreate them.

3 Likes