Constantly increasing Memory usage?

  • Platform information:
    • Hardware: Raspi3
    • OS: Jessie (openhabian)
    • Java Runtime Environment: openjdk version “1.8.0_152”
      OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-
      arch32hf) (build 1.8.0_152-b76)
      OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf)
      (build 25.152-b76, mixed mode, Evaluation)
    • openHAB version: OH 2.2
      Action: MQTT
      Bindings used : Tankerkönig, MQTT, Intertechno, HTTP, Network, Sonos, System Info, Weather
      Persistence: mapDB, rrd4j
      Transformations: JavaScript, JSONPATH, MAP, REGEX
      Other stuff runing on Raspi: MQTT Server

Running the system for 5 days now and I do observe an increase of memory usage from initially 35% to 42% now. Increase not steady, migth be related to works on .items and sitemap file. Or is such a first indication of a failing SD card.

I wouldn’t worry about it. It isn’t a problem right now. The increases seem reasonable of you’ve been adding items and rules…

This would not be a symptom of a failing sd card. If there is a problem, it would be a big one the code. But this doesn’t look like a problem, at least not yet.

Hi @rlkoshak , I’m starting with RP3 running openhabian. Now the ram usage is 87%. Is it a good number? Or are higher than normal?

:confused: I meant editing the sitemap and items files in order to change the displayed items, nothing was added concerning items and Rules.

If it continues to go up then it might be a problem, but like I said, it would be a bug in OH, not something you’ve done. At that point, you start removing bindings one by one to try and identify which, if any is the culprit.

There is no normal really. If all you are running is OH then that might be a bit high. But if you are running other services like Mosquitto or InfluxDB then that doesn’t sound too high.

Yes, I’m running a Mosquitto Broker and some bindings. Thanks!

Did some more testing. Restarted the System and let it run for 2 days with OH and mosquitto running. User interaction was showing sitemaps only. Observed no increase in Memory usage. After that connected via SSH and opened the a sitmemap file with Editor “nano” and selected an item to be displayed and saved the file again, this resulted in an increase of Memory usage from 34,8% to 36%. Intially the increase was up to 35,4%, the other increase was within the following hour. After that the Memory usage remained steady at the higher level.
Doing the same test again (removing the item from the sitemap) resulted in another increase from 36% to 37%.

I would have expected the Memory usage to drop again after the file was saved, but that never happened. I will further invest if it is really related to OH or more to OS/Editor.

Java doesn’t work like that. Unless things have changed at some point, once a Java program grabs some memory it never lets it go. It will reuse and free internally to itself memory once it doesn’t need it but it won’t give the memory back to the system.

I would expect at some point that 1-2% increase in RAM usage will eventually stop growing with you update your sitemap or other files.

I didn’t know that. Thanks for that.

Hi,

I would like to up this topic as I see constantly growing memory usage of openhab2.
See here :

Sometimes, If I don’t restart openhab, it will reach almot 100% RAM and eat swap.
I do not “disturb” openhab from ssh, smb or config files.
This is not a “new” problem for me, I was waiting few months to be sure before asking here.

Ask me for more details if needed.

Thank you


Config :

  • Openhab 2.3.0 stable running in proxmox
  • All config is done with .items, .things, .rules
  • Here is a dump of bundle:list :
START LEVEL 100 , List Threshold: 50
 ID | State    | Lvl | Version                | Name
----+----------+-----+------------------------+--------------------------------------------------------------------------------------------------------------------------------
 15 | Active   |  80 | 5.3.1.201602281253     | OSGi JAX-RS Connector
 16 | Active   |  80 | 2.4.5                  | Jackson-annotations
 17 | Active   |  80 | 2.4.5                  | Jackson-core
 18 | Active   |  80 | 2.4.5                  | jackson-databind
 19 | Active   |  80 | 2.4.5                  | Jackson-dataformat-XML
 20 | Active   |  80 | 2.4.5                  | Jackson-dataformat-YAML
 21 | Active   |  80 | 2.4.5                  | Jackson-module-JAXB-annotations
 22 | Active   |  80 | 2.7.0                  | Gson
 23 | Active   |  80 | 18.0.0                 | Guava: Google Core Libraries for Java
 24 | Active   |  80 | 3.0.0.v201312141243    | Google Guice (No AOP)
 25 | Active   |  80 | 1.5.8                  | swagger-annotations
 26 | Active   |  80 | 3.19.0.GA              | Javassist
 28 | Active   |  80 | 3.5.2                  | JmDNS
 30 | Active   |  80 | 1.0.0                  | Units of Measurement API
 32 | Active   |  80 | 1.1.0.Final            | Bean Validation API
 33 | Active   |  80 | 2.0.1                  | javax.ws.rs-api
 34 | Active   |  80 | 3.2.0.v201101311130    | ANTLR Runtime
 35 | Active   |  80 | 3.2.1                  | Commons Collections
 36 | Active   |  80 | 1.1                    | Commons Exec
 37 | Active   |  80 | 2.2.0                  | Commons IO
 38 | Active   |  80 | 2.6                    | Commons Lang
 48 | Active   |  80 | 4.1.5                  | Apache Karaf :: OSGi Services :: Event
 67 | Active   |  80 | 2.11.0.v20150805-0538  | EMF Common
 68 | Active   |  80 | 2.11.1.v20150805-0538  | EMF Ecore
 69 | Active   |  80 | 2.11.1.v20150805-0538  | EMF XML/XMI Persistence
 70 | Active   |  80 | 3.8.0.v20160509-1230   | Common Eclipse Runtime
 71 | Active   |  80 | 3.6.100.v20160223-2218 | Extension Registry Support
 80 | Active   |  80 | 9.3.21.v20170918       | Jetty :: Proxy
 94 | Active   |  80 | 0.2.1.v20170706-0855   | org.eclipse.lsp4j
 95 | Active   |  80 | 0.2.1.v20170706-0855   | org.eclipse.lsp4j.jsonrpc
 96 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Config Core
 97 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Configuration Discovery
 98 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Configuration mDNS Discovery
 99 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Config Dispatcher
100 | Active   |  75 | 0.10.0.oh230           | Eclipse SmartHome Config XML
101 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Core
102 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Core Audio
103 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome AutoUpdate Binding
104 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Core Binding XML
105 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Core ID
106 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Core Persistence
107 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Scheduler Service
108 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Core Thing
109 | Active   |  75 | 0.10.0.oh230           | Eclipse SmartHome Core Thing XML
110 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Transformation Service
111 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Core Voice
112 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Console
113 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Console for OSGi runtime Karaf
114 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome JavaSound I/O, Fragments: 180
115 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Monitor
116 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Net I/O Bundle
117 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome REST Interface Bundle
118 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Core REST API
119 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome REST mDNS Announcer
120 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome REST Interface JAX-RS optimization Bundle
121 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Sitemap REST API
122 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome SSE REST API
123 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Voice REST API
124 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Bonjour/MDS Service Discovery Bundle
125 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Web Audio Support
126 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Model Core
127 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Item Model
128 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Item Model IDE
129 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Item Model Runtime
130 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Language Server
131 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Persistence Model
132 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Persistence Model IDE
133 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Persistence Runtime
134 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Rule Model
135 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Rule Model IDE
136 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Rule Runtime
137 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Script
138 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Script Model IDE
139 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Script Runtime
140 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Sitemap Model
141 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Sitemap Model IDE
142 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Sitemap Runtime
143 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Thing Model
144 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Thing Model IDE
145 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Thing Model Runtime
146 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Json Storage Service
147 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome UI
148 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome UI Icons
149 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Classic IconSet
150 | Active   |  80 | 2.12.0.v20170518-0757  | Xtend Runtime Library
151 | Active   |  80 | 2.12.0.v20170518-0757  | Xtend Macro Interfaces
152 | Active   |  80 | 2.12.0.v20170518-0959  | Xtext
153 | Active   |  80 | 2.12.0.v20170519-0752  | Xtext Common Types
154 | Active   |  80 | 2.12.0.v20171017-1700  | Xtext IDE Core
155 | Active   |  80 | 2.12.0.v20170518-0959  | Xtext Utility
156 | Active   |  80 | 2.12.0.v20170519-0752  | Xbase Model
157 | Active   |  80 | 2.12.0.v20170519-0752  | Xbase Generic IDE Services
158 | Active   |  80 | 2.12.0.v20170518-0757  | Xbase Runtime Library
173 | Active   |  80 | 2.3.0                  | JUPnP Library
174 | Active   |  80 | 1.9.6                  | MIME streaming extension
175 | Active   |  80 | 5.0.2                  | Require-Bundle Fix :: org.objectweb.asm
177 | Active   |  90 | 2.3.0                  | openHAB Core
178 | Active   |  80 | 2.3.0                  | openHAB Karaf Integration
180 | Resolved |  80 | 2.3.0                  | openHAB Sound Support, Hosts: 114
181 | Active   |  80 | 2.3.0                  | openHAB Dashboard UI
186 | Active   |  80 | 3.1.4                  | Stax2 API
187 | Active   |  80 | 1.0.2                  | Units of Measurement Common Library
188 | Active   |  80 | 1.0.8                  | Units of Measurement Implementation for Java SE
190 | Active   |  80 | 1.0.6                  | Californium (Cf) OSGi Bundle
191 | Active   |  80 | 1.6.0                  | Commons Codec
192 | Active   |  80 | 3.2.0                  | Commons Net
193 | Active   |  80 | 4.2.3                  | Apache HttpClient OSGi bundle
194 | Active   |  80 | 4.2.3                  | Apache HttpCore OSGi bundle
195 | Active   |  80 | 3.1.0.7                | Apache ServiceMix :: Bundles :: commons-httpclient
196 | Active   |  80 | 1.0.6                  | element-connector
197 | Active   |  80 | 1.0.6                  | Scandium (Sc) Core
198 | Active   |  80 | 0.10.0.oh230           | TR?DFRI Binding
199 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome IoT Marketplace Extension Service
200 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Basic UI, Fragments: 211
201 | Active   |  80 | 0.10.0.oh230           | Eclipse SmartHome Paper UI, Fragments: 213
202 | Active   |  80 | 2.3.0                  | Chromecast Binding
203 | Active   |  80 | 2.3.0                  | Freebox Binding
204 | Active   |  80 | 2.3.0                  | Xiaomi Mi Smart Home Binding
205 | Active   |  80 | 2.3.0                  | Netatmo Binding
206 | Active   |  80 | 1.12.0                 | openHAB Weather Binding
207 | Active   |  80 | 2.3.0                  | openHAB 1.x Compatibility Layer
208 | Active   |  80 | 2.3.0                  | openHAB Cloud Connector Bundle
209 | Active   |  80 | 1.12.0                 | openHAB InfluxDB Persistence bundle
210 | Active   |  80 | 1.12.0                 | openHAB MapDB Persistence Bundle
211 | Resolved |  75 | 2.3.0                  | openHAB Basic UI Fragment, Hosts: 200
212 | Active   |  80 | 2.3.0                  | HABPanel User Interface
213 | Resolved |  75 | 2.3.0                  | openHAB Paper UI Theme Fragment, Hosts: 201
214 | Active   |  80 | 2.3.0                  | VoiceRSS TTS Voice Service
216 | Active   |  80 | 2.4.0.201806171210     | Xiaomi Mi IO Binding

I found which binding is causing this issue.

Issue opened here :

2 Likes

That is no small feat. I’m glad you were able to Barrow it down. Thanks for the issue.