Performance issues after clear cache and docker down/up

  • Platform information:
    • Hardware : Intel x86_64
    • OS: SMP Debian 5.10.205-2 (2023-12-31) x86_64 GNU/Linux
    • Java Runtime Environment : from docker image: openhab/openhab:3.4.5

I’m running OH in a docker container, starting from docker image : openhab/openhab:3.4.5.
I’ve installed the following addons, in the order: airquality,astro,ecowatt,http,modbus,openuv,meteoalerte,mqtt,systeminfo

A few weeks ago, I loaded a wrong config, so to speak, probably causing a loop on MQTT broker, and I was obliged to remove the wrong .things files, clear the cache and remove the docker container (docker down) to be sure to delete everything related to the wrong config.
To clear the cache, I mean: remove userdata/cache/* , userdata/tmp/* and userdata/jsondb/backup/*

But later, I noticed a kind of surge on cpu and memory curves, they were increasing more and more until I did just a ‘docker restart’ : after that, both cpu and memory returned to being stable again.

I did few tests, loaded a config fixing the previous errors and restart the docker to take it correctly into account…everything seemed OK yeah!! But doing again the combo : clear the cache + docker down/docker up, few hours later I reproduced the strange increase of cpu and memory – see screenshots here attached.
The docker restart has saved again the situation, returning them to the usual level.

So my question : what could be the root cause of these performance issues, an internal mechanism in openhab related to garbage collector, something stored inside the docker…or how to properly investigate (because after checking logs several times, of course, and installed systeminfo bindings to display more infos, I got anything of rilevant explaining that…)

I was also wondering if I’d rather upgrade openhab to 4.1.3 to mitigate these issues on cpu, memory and side effects related to docker container…
In the screenshots, you will find the curves drawed with telegraf+grafana installed on my server, pointing specifically on openhab docker.

Thanks for your help or your tips!


Clearing the cache requires OH to go back out to the internet, redownload all your installed add-ons and reinstall all those add-ons. That can take some time and it can take some processing power to complete. I would expect the CPU usage to spike after clearing the cache for a bit but it should settle after awhile once all the add-ons are successfully reinstalled.

Typically, because it’s so disruptive, clearing the cache should only be done during an upgrade (in which case the Container does it for you) or when you’ve had some problem installing/removing add-ons. It’s not really useful an any other situations and it’s very disruptive.

Assuming there really is a problem here, it’s not going to be a fix that’s backported so you’d have to install a newer OH version to get the fix anyway. OH 4.1 comes with a different version of karaf and since this is related to installing add-ons, it very likely is fixed in 4.1 or in the soon to be released 4.2.