If I’m stopping openhab swap is down. That is what why i don’t understand why Openhab isn’t the issue. Sorry. Than I’m to stupid to understand this. As i show you details above what memory and swap is fully ok and it starts to rising if i start Openhab.
You are welcome to do so. I don’t say this often, but you’d be completely wrong but there is no law against that.
Yes you do! It’s taking so long to swap stuff in and out of RAM that safety measures built into OH to prevent a thread from running forever kick in and start killing things and generating warnings and errors.
The system load in your htop screen shots indicate otherwise. A system load above 1 is usually considered a problem. One of your load averages is 6 .
It’s not just openHAB. Swap is a system level resource. The sum total of all your processes RAM requirements is greater than the RPi 3 can handle. You are just noticing the problem with OH because you are using it, and because many parts of OH are used relatively infrequently, OH’s RAM is the most likely to be swapped out in the first place.
Based on your htop screen shots, OH isn’t really using an unusual amount of RAM. Maybe you can address this system problem by changes to OH, but OH is not the problem. You have too much stuff running on this machine.
OH has a set limit in the total amount of memory it can consume. Once it hits that limit it crashes and exits. OH does not have a memory leak here or else you’d see OutOfMemory exceptions in openhab.log
They are probably taking a little bit longer to start up than usual. But once started, there RAM is constantly being used so unlikely to be swapped out. But that means stuff that isn’t being used constantly (e.g. parts of OH memory) is being swapped out.
Total RAM usage is the problem. Of course memory use and swap use is going to go down when you stop OH. OH uses a lot of RAM. What happens if you leave OH running and stop InfluxDB and Grafana? Does the swap use go down? Does the memory use go down? Of course it does because both of those also use RAM and, if RAM runs out swap.
No because the programs themselves do not get to decide when their memory goes to swap (yes, I know there are ways you can pin memory so it doesn’t get swapped but to my knowledge OH doesn’t use that and I’m not certain Java even supports that). All that will show you is those programs have more stuff in memory that isn’t used as frequently as stuff in memory used by other programs.
Ultimately most of this thread is coming from confirmation bias. You are convinced that OH is the problem so much so that you’ve not even considered looking for any other evidence and in fact have rejected evidence that could point to something else, even though we’ve explained at length the reasons why OH is not the root of the problem, running too much on the machine is.
tl;dr: Based on your own screen shots:
OH is not using an unusual amount of RAM on your machine
there are no OOM exceptions reported so there is no memory leak
all of your RAM and a good chunk of your swam are in use
all of the problems with OH reported here can be explained by the fact that swap is in use
I’ve presented a full analysis and explanation as has @Oliver2 . I believe other experts on this thread agree with these conclusions. You are free to disagree or reject that analysis but, thus far, all of your arguments against it denote a misunderstanding of how computers work (that’s not a dig, this isn’t something most people ever have to know about or deal with). I’ve tried but I apparently can’t fix misunderstanding.
I wish you the best of luck! I can offer nothing else here.
This seems me to be where your misunderstanding lies. In terms of system performance any swap is “high” swap. Yes, you have more drive space allocated to hold swapped memory but that doesn’t mean anything at all (and can be arbitrarily configured). You’ve already hit you peak RAM if the system has had to move anything at all to the swap space. Swap is an emergency stopgap, not a long term solution for system performance. If a system is consistently running with swap memory in use than that system is not properly matched between its hardware and usage profile. Period. End of story.
Instead of looking at what is using the swap memory, you have investigate why the system needs swap memory in the first place, and this has already been answered.
An RPI3 is barely enough to run OH4 without any additional load. You are adding additional load.
The story doesn’t go beyond this. There isn’t a memory leak. It doesn’t matter at all which load is which. It simply adds up to more than can be held in RAM and the system must resort to swap.
That’s a perfectly reasonable test. Now test what happens if you just run openhab without all the other services on the system. What happens then? I can tell you if you don’t want to check yourself: the swap usage will also be down.
Openhab is only the issue you see. I promise you that when your openhab rules start running all the other services have issues as well. Does your rule change an item state? Well then that item is persisted to you InfluxDB, but maybe that was swapped out for the rule thread and now the system has to swap back. Does Grafana connect to InfluxDB (don’t know why you’d have it if it doesn’t), now the Grafana update is also impacted…etc.
Quite frankly, with everything you’re trying to run, I’m surprised your rules only take 5 to 10 minutes.
No… Openhab isn’t response itself. Not the rules take this time… I must wait 5-10min and everything is working. All rules items aren’t working in this time.
Right, you must wait while the system shuffles around RAM and swap memory to get even the basic OH system processes running.
Not according to your original post where openhan will then crash a short time later. That crash is because the swap issue continues to build a back log until you do finally completely run out of system resources.
These are smaller programs which might even fit into the remaining 15% memory space or where you do not really notice if the system is engaged a few seconds with swapping
I have a question as I haven’t found information about this.
Is your system 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 / now ?
Sure that is a good point. Now i will wait what we get with the commands for swap. Before I start with a fresh install… And all guys here gave me so many hints. I will post this here and then I can decide what I do as next. But at the moment swap isn’t high to collect information’s.
I think you have a few bindings installed in the addons directory. Did you make sure with their maintainers that all of them are working with OH4?
See here