I recently installed the network health binding and I’ve detected that openhab is leaking memory (see graphs below). Is there a way to inspect memory usage by objects in rules?
(drops correspond to openhab service restart)
NB: I don’t know if this problem is new for me
This might be normal behavior for Java. The way Java works is usually it has a maximum memory size and if it is not close to that max it is kind of lazy about garbage collection so the memory usage will tend to grow until the max is approached. This is particularly true with long running server applications like OH.
Another thing that could be happening is once a Java application acquires memory it never gives it back to the OS so the size of a Java program in RAM can only every grow.
Or there could be a memory leak. It is notoriously difficult to find memory leaks in Java unfortunately and it could be coming from core or any of those bindings.
My current instance of OH which has been running around a week without a restart is sitting at 3.6 Gb virtual memory but only 346 Mb of physical memory. I can’t say how it has grown to that over time, whether this is unusual, and how quickly it grew to that.
I’d love to hear what one of the developers or someone who has hooked up a profiler to OH might have to say on the matter.
NOTE: My info on the behavior of Java comes from at least five years ago Java EE applications running on things like Tomcat, JBoss and Weblogic. It may not work like this anymore. Also, the JVM also provides a number of features to fine tune the above behavior which I have not looked to see what, if any, OH is using. In other words, my conjecture could be bunk.
I can confirm this.
I had openhab 2.0.0 running since relase and installed Network Health binding yesterday. Same problem here, have tried to just adding two devices and slowed it really down with refreshrate of 60000ms, but still it seems to be a memory leak.
Did anyone verify whether this is in fact a Network monitor binding issue?
I am slowly depleting my memory - gets worse when I have network outages.
Is there a workaround?
Did I mention I am seeing this in 2.3.0 ?