openHAB 3 runs out of memory / java heap space errors, CPU 100%+ after a few hours

@Pedals2Paddles: Did you already create a git issue?

I’m observing a similar issue: round about 24 hours of running openhab3 in a docker container (clean install, setup from scratch) the VM throws an out-of-memory error and becomes slow beforehand. I suspect heavy rule-execution or exec-binding at the moment and will disable those one by one and hopefully narrow it down a bit


Same question, do you have set up DSL rules via the UI? If so, put them in files like you did in OH2. That did the trick at my case and since then i have extremely low CPU and everything is stable

please post link to git issue so we can play along at home
thanks

2 Likes

I don’t get memory leaks but i have a similar situation with long waiting issues of dispatch events:

dispatching event to subscriber ‘org.openhab.core.internal.items.ItemUpdater@1e6b6a0’ takes more than 5000ms

I will update all items to model simantics and it will go slower and slower


Openhab will lost all network connections. No network things will be reached. After reboot everything is fine.

That actually fixed it for me. Up and running for 4 days now without issues. I only moved 2 highly-frequented rules back to files, that seems to do the trick.

That problem is solved in the current snapshots!

What specifically has been fixed?

That git issue i posted earlier

Hi all. I had the same problem. Openhabian running out of memory and 100% CPU on my Raspi3. I used the workaround to move the same rules I had into files and the problem is now gone. My instance is running smoothy since 3 days ago.
Thanks for the hint.
I hope and suppose the bug fix will be available with the next version. I think to have seen on the github repository the version 3.1.0. But I’m not an expert on how it works this.
Anyway, the workaround works so far.

1 Like

Hi,

for me the problem is not solved (except I use the .rules files again) for me.
The CPU Load for the JAVA process is going through the roof (most of the time > 100%), even if there is enough MEM available. But of course I am not that expert that can see what happens really to the memory.
But a screenshot shows the situation short before the OOM Message in the log appears. Machine is getting slower and slower and at the end complete responseless on a click in the WebUI.
I am on Snapshot 3.1 Build #2159. (Raspbery Pi4 8GB)

Bildschirmfoto 2021-01-22 um 11 59 03

I did a lot of testing today for rules which were created and maintained via WebUi. So, entering, rules, saving, running. All the stuff, and at the end the responsiveness decreased


Hope this input helps (?)

Best regards
Stefan

as i mentioned in the git issue, you seem to have a different root cause. I could not reproduce “my” problem with the build you mentioned.

i have the same problem, cpu load gos over 99% and then i get always in the log

java.lang.OutOfMemoryError: Java heap space

i only use rules in files, from openhab2

if you need more information please say it.

Happened to me today again. Suddenly noticed OH was lagging, when I checked all cpu was eaten by java. No errors whatsoever in the log. After restarting OH everything returned to normal. This is with version 3.0.1 so the DSL rules fix doesn’t seem to have solved the problem, at least not for me. Anyone has any more ideas?

same here as marc1310 and Daniel, rules in files (none added via UI), takes about 24 hours to freeze with Java heap space. I’m on 3.1.0 #2161, but it happened in latest stable too, hence the snapshot I’m using.
Nothing specific in the logs that can point me somewhere.

I have also this problem with oh3.1 milestone 1.

This is not an openHABian issue, this is clearly a openHAB issue so please remove openHABian from the title.

1 Like

After a crash I had to completely reinstall my server today, including the latest Openhab 3.0.1 version.
For me, too, the CPU load increases and the system freezes.

System configuration:

System:

> runtimeInfo:
>   version: 3.0.1
>   buildString: Release Build
> locale: de_DE
> systemInfo:
>   configFolder: /etc/openhab
>   userdataFolder: /var/lib/openhab
>   logFolder: /var/log/openhab
>   javaVersion: 11.0.8
>   javaVendor: Azul Systems, Inc.
>   javaVendorVersion: Zulu11.41+23-CA
>   osName: Linux
>   osVersion: 4.19.0-14-amd64
>   osArchitecture: amd64
>   availableProcessors: 4
>   freeMemory: 71011760
>   totalMemory: 334495744

I agree with Ethan
@Pedals2Paddles Matt
could you please remove OpenHabian from title and also openhabian tag
thank you

Edit - nevermind, I did it myself