Openhab 5.0.1 on docker java-21 high cpu and ram usage

About a week ago I upgraded my docker system from OH 4.3.3 to 5.0.1 on a Raspi 5 headless with 8 MB of RAM by:
backing up userdata, addons and conf
stopping the openhab container
sudo apt update
sudo apt full-upgrade -y
sudo apt autoremove -y
sudo shutdown -r now

Changed my docker-compose.yml from 4.3.3 to 5.0.1 and installed the images without problems.

Starting the ssh session I get:
Linux docker 6.12.34+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.34-1+rpt1~bookworm (2025-06-26) aarch64

System ran fine for about a week.

Today access by ssh on wlan and eth0 interfaces is really slow.
Ping times from another system are around 2 sec or “Zeitüberschreitung”.

ps -auxw shows high usage of cpu (and ram ?):
root 2406 43.3 17.7 6757184 1464624 ? Sl 11:12 10:53 /usr/lib/jvm/java-21-openjdk-arm64/bin/java -XX:-UsePerfData -Dopenhab.home=/openhab -Dopenhab.conf=/openhab/conf -Dopenhab.runtime=/openhab/run

Sometimes cpu-usage goes up to 60 %.

Is it possible the high cpu-usage affects responsiveness of ssh?

Any suggestion to get my system running smoothly again?

I can confirm the same problems. Unfortunately, I haven’t found a solution.

Yes, if the CPU is also placing a high load on the system. What do you see in top or htop in terms of system load and memory usage?

Running the following command in the karaf console will tell you which threads in OH are using the most CPU.

ttop --stats=tid,name,state,waited_time,waited_count,blocked_time,blocked_count,user_time,cpu_time,user_time_perc,cpu_time_perc,lock_owner_id,lock_owner_name --order=cpu_time --millis=300

See High CPU Usage since upgrade to 5.0.1 - #4 by rlkoshak for details.

So far the number one culprit has been rules. However, there is a strange bug that just got fixed which lead to an infinite loop when running a persistence action from a rule on InfluxDB and there was no data there over the requested time period (if I understand the problem correctly). So double check that as well.

top gives:
load average: 1.15, 0.58, 0.37

The first value quite often is above 1, sometimes 1.6
When top and htop show a high cpu load it is always java (top) or java-21-opensdk (htop) in the lead.

I am not using influxdb, I am using RRD4J.

With ttop in Karaf I found a rule running every minute which might have caused the high cpu-load.

One day later:
Response times of SSH are back to normal - pretty fast.
I had a Wifi-Problem (Changed repeater for appliances in the basement). Therefore some things and corresponding items were not updated. The rules using these items (some running every minute, some triggered by change of Item-States) could not work. Values of the items were not updated to RRD4J. My guess is that the rules not working caused the high CPU-load.

Thanks for your help!