High CPU and restarts after upgrade to OH4

I can see that the CPU load is also very high. I use a raspberry 4 with 4 GB. Memory usage is fine for me but CPU load of one is by 100%.

There are a lot of processes with the same parameters / modules

I’m not sure if the memory settings of these processes are correct or can be changed and if it helps.

To establishing a connection to the Raspberry needs much more longe like before but OH4 itself works for me fine.

Try restarting OH again. That worked for me. After first restart one Core at 100%, after second restart and ~4hours:

OH restarts every day. That doesn’t help. Also cache was deleted but never changed anything. I’m not sure about the 100 processes. I have 177 Things and over 600 Items. It could be that every thing has an own process but not sure.

Are you running out of Memory?

MAybe you have a look here:

Maybe you should increase in /etc/default/openhab:

EXTRA_JAVA_OPTS=“-Xms900m -Xmx2000m”

Of course depending on your hardware…

Many thanks, today morning the CPU usage is normal. I will check it today every hour to figure out what the reason can be. I guess that something loops.

Mind my post on the main thread please. This is why I moved yours to a separate thread.

Now an update : it’s really not easy to figure out. Today the CPU Load is by 100 % for one CPU. After restart the service it works normal. To figure out I add an item for the CPU load and add it for the persistence group too. I’m not sure if it works and how but I hope that this allows to check the logs in the time after CPU load increase.

One problem what I have : there are a lot of Java processes but no ID to the whatever … item, rules, trigger, … for further version of OH it would help if there is a id which allow a conclusion for whta it is.

Yes. but that’s out of scope of openHAB, these are all child processes of the main java command, maybe a specialized java tool would help

Assuming you’re on a local network and you have a Windows laptop you can try to add visualvm (included in jdk downloads) to the openhab Java process. That shows more detailed information.

1 Like

Same here… high CPU usage after upgrading from 3.4.4 to 4.0.1

I have a question about this. Is this a migrated installation from Buster to Bullseye ?
In case it is was that a 32 bit Buster installation ?
In case it was what is the output of command: uname -a after this migration ?

Yes, I have migrated to Bullseye because otherwise I’m not able to install Java 17.


uname -u

Actual it works for me. I figure out that I have a binding thats not compatible to OH 4 (in this case it was installed manually by myself). After I removed it the high CPU load was gone.

Very important is to clear the cache.

In my case is an upgrade, I am using a mini PC with Windows 10.

I have shutdown OH 3.4.4, installed Zulu Java 17, uninstalled Java 11 and perform a update of OH using command line bat (as I have done all.other times and upgrades).

Edited: cache and temp folders cleared after first reboot, because I have problems after that (not before reboot). From then all is working correctly except for the high CPU usage. I have changed the 3 transformations that I use from JS to DSL inline, so don’t have to use JS binding.

Last update: After 36 hours and without any new intervention, CPU usage has been lowered to levels only a bit more than before 4.0.1. I don’t know what happened.

Also memory has increassed only a little more than before.

1 Like

This version is killing me… after a system reboot I have this issue:
Bug since OH4: Why are the default.sitemap and *.things files not loaded on startup? (empty sitemap list) - Setup, Configuration and Use / Runtime - openHAB Community
Solved cleaning cache and tmp folder and restarting OpenHAB… now, CPU usage is at 100%.


Have you seen this thread? There is a work around being tested, that link is the post with instructions to install patch. Report your issue in that thread or on git hub issue

Thanks very much, i haven’t read it. I will read and try, and report results.


Thanks so much I have tested and I reporting on the thread, it seems that is solved… I need a little more time to see that the results are consistents, but looks ok!

1 Like