I am already familiar with everything you wrote (with regards to rules, and thanks to this thread, also with regards to timers).
I donβt use any Thread::sleep, all my sendHTTP* calls were within createTimer to prevent rules hanging, and apart of this my rules donβt use any timers (I do have 16 cron-based rules and 3 astro-based rules, but they are all well spread along the day).
I am not familiar, though, with the OS, how it should behave, and how to analyze the usage of resources, and making sure it works as it should, or I should look into specific areas and analyze them.
I am looking for what causes the number of threads growing on my system, and whether this is a "temporary"grow (and threads get released over time) or it is a βconstantβ grow.
If it helps, my setup is using openhabian over a RPi 3B+ with the following bindings:
Astro (only 3 very short rules are triggered by the astro binding)
Expire (~30 items using it)
HarmonyHub
Xiaomi Mi (2 nodes connected to it)
Network (pinging 4 iPhones)
Samsung Tv (polling every 1 second)
openHAB Weather (polling every 2 minutes)
YamahaReceiver (polling every 10 seconds)
ZWave (~22 nodes connected to it)
Also using:
openHAB Cloud connector
Google Calendar connector
Mapdb for RestoreOnStartup
Influxdb for some other items (installed grafana as well, but didnβt βplayβ with it too much, yet)
Here is a the full bundle list:
openhab> bundle:list
START LEVEL 100 , List Threshold: 50
ID β State β Lvl β Version β Name
20 β Active β 80 β 5.3.1.201602281253 β OSGi JAX-RS Connector
21 β Active β 80 β 2.7.0.v20170129-0911 β Gson: Google Json Library for Java
22 β Active β 80 β 18.0.0 β Guava: Google Core Libraries for Java
23 β Active β 80 β 3.0.0.v201312141243 β Google Guice (No AOP)
26 β Active β 80 β 3.5.5 β JmDNS
28 β Active β 80 β 1.0.0 β Units of Measurement API
30 β Active β 80 β 1.1.0.Final β Bean Validation API
31 β Active β 80 β 2.0.1 β javax.ws.rs-api
32 β 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
47 β Active β 80 β 4.2.1 β Apache Karaf :: OSGi Services :: Event
63 β Active β 80 β 4.6.0 β Apache XBean OSGI Bundle Utilities
64 β Active β 80 β 4.6.0 β Apache XBean :: Classpath Resource Finder
65 β Active β 80 β 2.12.0.v20160420-0247 β EMF Common
66 β Active β 80 β 2.12.0.v20160420-0247 β EMF Ecore
67 β Active β 80 β 2.11.0.v20160420-0247 β EMF Change Model
68 β Active β 80 β 2.12.0.v20160420-0247 β EMF XML/XMI Persistence
69 β Active β 80 β 3.8.0.v20160509-1230 β Common Eclipse Runtime
70 β Active β 80 β 3.6.100.v20160223-2218 β Extension Registry Support
80 β Active β 80 β 9.4.11.v20180605 β Jetty :: Proxy
94 β Active β 80 β 0.4.1.v20180515-1321 β org.eclipse.lsp4j
95 β Active β 80 β 0.4.1.v20180515-1321 β org.eclipse.lsp4j.jsonrpc
96 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome OAuth2Client
97 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Config Core
98 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Configuration Discovery
99 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Configuration mDNS Discovery
100 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Config Dispatcher
101 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome Config XML
102 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Core
103 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Core Audio
104 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Core Binding XML
105 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Core ID
106 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Core Persistence
107 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Scheduler Service
108 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Core Semantics
109 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Core Thing
110 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome Core Thing XML
111 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Transformation Service
112 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Core Voice
113 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Console
114 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Console for OSGi runtime Karaf
115 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome HTTP Interface Bundle
116 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome JavaSound I/O, Fragments: 183
117 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Monitor
118 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Net I/O Bundle
119 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome REST Interface Bundle
120 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Core REST API
121 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome REST mDNS Announcer
122 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome REST Interface JAX-RS optimization Bundle
123 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Sitemap REST API
124 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome SSE REST API
125 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Voice REST API
126 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Bonjour/MDS Service Discovery Bundle
127 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Web Audio Support
128 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Model Core
129 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Item Model
130 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Item Model IDE
131 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Item Model Runtime
132 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Language Server
133 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Persistence Model
134 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Persistence Model IDE
135 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Persistence Runtime
136 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Rule Model
137 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Rule Model IDE
138 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Rule Runtime
139 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Script
140 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Script Model IDE
141 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Script Runtime
142 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Sitemap Model
143 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Sitemap Model IDE
144 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Sitemap Runtime
145 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Thing Model
146 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Thing Model IDE
147 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Thing Model Runtime
148 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Json Storage Service
149 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome UI
150 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome UI Icons
151 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Classic IconSet
152 β Active β 80 β 2.14.0.v20180522-1629 β Xtend Runtime Library
153 β Active β 80 β 2.14.0.v20180522-1629 β Xtend Macro Interfaces
154 β Active β 80 β 2.14.0.v20180522-1821 β Xtext
155 β Active β 80 β 2.14.0.v20180522-1833 β Xtext Common Types
156 β Active β 80 β 2.14.0.v20180522-1821 β Xtext IDE Core
157 β Active β 80 β 2.14.0.v20180522-1821 β Xtext Utility
158 β Active β 80 β 2.14.0.v20180522-1833 β Xbase Model
159 β Active β 80 β 2.14.0.v20180522-1833 β Xbase Generic IDE Services
160 β Active β 80 β 2.14.0.v20180522-1629 β Xbase Runtime Library
175 β Active β 80 β 1.9.6 β MIME streaming extension
177 β Active β 80 β 6.2.0 β org.objectweb.asm
178 β Active β 80 β 6.2.0 β org.objectweb.asm.commons
179 β Active β 80 β 6.2.0 β org.objectweb.asm.tree
180 β Active β 90 β 2.4.0 β openHAB Core
181 β Active β 80 β 2.4.0 β openHAB Karaf Integration
183 β Resolved β 80 β 2.4.0 β openHAB Sound Support, Hosts: 116
184 β Active β 80 β 2.4.0 β openHAB Dashboard UI
189 β Active β 80 β 1.0.2 β Units of Measurement Common Library
190 β Active β 80 β 1.0.8 β Units of Measurement Implementation for Java SE
191 β Active β 80 β 1.6.0 β Commons Codec
192 β Active β 80 β 3.3.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 β 2.4.0 β openHAB 1.x Compatibility Layer
197 β Active β 80 β 1.1.1.201605111122 β Swagger Provider
198 β Active β 80 β 2.4.5 β Jackson-annotations
199 β Active β 80 β 2.4.5 β Jackson-core
200 β Active β 80 β 2.4.5 β jackson-databind
201 β Active β 80 β 2.4.5 β Jackson-dataformat-XML
202 β Active β 80 β 2.4.5 β Jackson-dataformat-YAML
203 β Active β 80 β 2.4.5 β Jackson-module-JAXB-annotations
204 β Active β 80 β 2.1.0 β json-path
205 β Active β 80 β 3.14.0 β nrjavaserial
206 β Active β 80 β 3.15.0.OH2 β nrjavaserial
207 β Active β 80 β 1.5.8 β swagger-annotations
208 β Active β 80 β 1.5.8 β swagger-core
209 β Active β 80 β 1.5.8 β swagger-jaxrs
210 β Active β 80 β 1.5.8 β swagger-models
211 β Active β 80 β 3.19.0.GA β Javassist
212 β Active β 80 β 2.2 β json-smart
213 β Active β 80 β 3.2.1 β Apache Commons Lang
214 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Astro Binding
215 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Configuration UPnP Discovery
216 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Configuration USB-Serial Discovery
217 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Configuration USB-Serial Discovery Linux sysf Scanning
218 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Config Serial
219 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Serial Transport
220 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Serial Transport for RXTX
221 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Serial Transport extension for RXTX RFC2217
222 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome UPnP Transport Bundle
223 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome Exec Transformation Service
224 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome JavaScript Transformation Service
225 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome JSonPath Transformation Service
226 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome Map Transformation Service
227 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome RegEx Transformation Service
228 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome Scale Transformation Service
229 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome XPath Transformation Service
230 β Active β 75 β 0.10.0.oh240 β Eclipse SmartHome Xslt Transformation Service
231 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Basic UI, Fragments: 249
232 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome WebApp UI, Fragments: 250
233 β Active β 80 β 0.10.0.oh240 β Eclipse SmartHome Paper UI, Fragments: 253
234 β Active β 80 β 2.5.1 β JUPnP Library
235 β Active β 80 β 1.13.0 β openHAB Telegram Action
236 β Active β 80 β 2.4.0 β Amazon Echo Control Binding
237 β Active β 80 β 1.13.0 β openHAB Expire Binding
238 β Active β 80 β 2.4.0 β HarmonyHub Binding
239 β Active β 80 β 2.4.0 β Xiaomi Mi Smart Home Binding
240 β Active β 80 β 2.4.0 β Network Binding
241 β Active β 80 β 2.4.0 β Samsung Tv Binding
242 β Active β 80 β 1.13.0 β openHAB Weather Binding
243 β Active β 80 β 2.4.0 β YamahaReceiver Binding
244 β Active β 80 β 2.4.0 β ZWave Binding
245 β Active β 80 β 1.13.0 β openHAB Google Calendar
246 β Active β 80 β 2.4.0 β openHAB Cloud Connector Bundle
247 β Active β 80 β 2.4.0 β openHAB REST Documentation
248 β Active β 80 β 1.13.0 β openHAB InfluxDB Persistence bundle
249 β Resolved β 75 β 2.4.0 β openHAB Basic UI Fragment, Hosts: 231
250 β Resolved β 75 β 2.4.0 β openHAB Classic UI Fragment, Hosts: 232
251 β Active β 80 β 2.4.0 β HABmin User Interface
252 β Active β 80 β 2.4.0 β HABPanel User Interface
253 β Resolved β 75 β 2.4.0 β openHAB Paper UI Theme Fragment, Hosts: 233
254 β Active β 80 β 0.9.10.v20160429-1435 β reflections (wrap)
255 β Active β 80 β 3.1.4 β Stax2 API
256 β Active β 80 β 1.5.8.v20160511-1038 β swagger-jersey2-jaxrs (wrap)
257 β Active β 80 β 1.13.0 β openHAB MapDB Persistence Bundle
There is another way to achieve a similar result, that is by using the ipcamera binding and the create gif feature. I have been considering adding the ability to output an mp4 file instead of a gif.
The way it works is simple.
Use a rule to turn on the create gif switch when your door is opened.
When the file is created the binding turns the switch off and this can trigger a rule to send the email.
No timers or sleep needed as the binding handles this for you.
The threads you listed make up all the rest of OH. Almost all of them are created and used by the core of OH and the bindings. You have no control over them.
I have no idea.
Maybe. It depends on how they are implemented. If thread pools are being used then there is a fixed number of threads that get reused. Otherwise it is the job of what ever part of the code that created the thread to release it when itβs done.
You would need to hook a profiler up to a running OH instance and be familiar with the code to understand what is creating Threads under what circumstances.
It seems like the number of threads continues to grow:
On June 16th at 22:21 it was 317
On June 17th at 08:15 it was 309
On June 18th at 19:49 it was 335
On June 19th at 00:21 it was 341
On June 19th at 10:16 it was 338
Are there any bindings / add-ons out of the ones I am using, that are known to cause this?
On the contrary - are there ones who are known for sure to NOT cause this?
(so I can try removing the remaining ones, one by one, and see which one causes this)
Or is it not that of an issue, as long as the CPU usage is not going high? (which currently seems like it is not going high)
I believe telegram supports sending the animated gif so you can upgrade from a static picture to a moving one right away. If I was to add mp4 output i am not sure what abilities it would have, need to experiment when I get some spare time as to what is possible. Features like preroll before you ask to record may not be possible which is with the gif.
First of all, we donβt know that this is unusual and we donβt know that it is a problem. what does matter is the CPU utilization and RAM utilization.
There are no bindings that are known to leak threads nor is there any part of the core that is known to leak threads. That doesnβt mean there arenβt any, we just donβt know it if they do.