openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.9k stars 3.59k forks source link

[solax] Possible memory / cpu leak issue with snapshot 4.3.0-20241114.032510-87 #17771

Open Andre1Becker opened 2 days ago

Andre1Becker commented 2 days ago

Current Behavior

Because of Fix the parsing of total consumption channel i've installed the snapshot version of this binding. Memory Usages creeps up from 2.3 GB to around 9 GB and CPU goes up to 98%ish of that container

I removed the Marketplace binding (Ver, 4.2.2) and copied the jar to the addons folder and restarted the docker container. After that it takes roughly 4-5 hours till openHAB becomes unresponsive. Removing the jar and installing the Marketplace addon, everything is working normal again.

I could reproduce this issue, but i cloud not troubleshoot it any further because lack of skills ;-) i cloud not see anything suspicious in the openhab logs regarding this problem.

Running openHAB Docker container 4.2.2 on unraid 6.12.13 with an Intel Core i5-6500 CPU @ 3.20GHz and 32 GB of RAM.

Andre1Becker commented 2 days ago

I just noticed this myself: I'm using oh 4.2.2 with a 4.3.0.x binding. Maybe that's causing the problem?

lsiepel commented 2 days ago

I just noticed this myself: I'm using oh 4.2.2 with a 4.3.0.x binding. Maybe that's causing the problem?

I would not expect that to be the cause. You could upgrade to the latest snapshot for both openHAB and the binding.

Andre1Becker commented 2 days ago

That's not that easy because this is my "production" setup :-)

lsiepel commented 2 days ago

Let's do some other checks before we try something like that.

lsiepel commented 2 days ago

Had a quick look and did not find anything directly pointing towards a leak. I did notice that the refresh command is calling an async update of all data causing a remote api call.

If you have many channels linked, this might cause some DDOS-like actions towards the remote API. Not 100% iuf this is the cause, but this can be improved.

There are some karaf commands that you could use to minitor threads: shell:threads | grep -i runnable | wc -l

In the OP you mention that you revert to the marketplace version. Do you also experience this issue with the stock version that comes with openHAB 4.2.2 ?

Andre1Becker commented 17 hours ago

Hey, no - stock version runs fine. There are 40 Channels i think that i have linked to items.

I've just switched to the snapshot binding and try to look into it a bit further. i try to monitor the threads as you mentioned. Anything else i could do?