[deconz] OOM after activating "deconz" binding
See original GitHub issueI am actually trying to get my raspberry Pi 3 running the openhab SNAPSHOT with deconz binding.
Expected Behavior
After activating the deconz software thing to support the raspbee in openhab it will be running.
Current Behavior
First of all I simply setup M8 Release and got an OOM after activating the deCONZ thing “A running software deCONZ software instance” with an exsisting API Key and then tried it with generating a new API Key. Both ended up in an OOM. I thought I will try the SNAPSHOT build, but ran into the same issue after adding the deconz thing (no additional sensors) to openhab:
2018-12-13 08:45:06.500 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.1.250:8080
2018-12-13 08:45:06.527 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.1.250:8443
2018-12-13 08:45:09.877 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2018-12-13 08:46:09.104 [INFO ] [.dashboard.internal.DashboardService] - Stopped Dashboard
2018-12-13 08:46:14.362 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.1.250:8080
2018-12-13 08:46:14.367 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.1.250:8443
2018-12-13 08:46:14.462 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2018-12-13 08:46:14.580 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2018-12-13 08:46:20.078 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-12-13 08:56:58.457 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.newArray(Native Method) ~[?:?]
at java.lang.reflect.Array.newInstance(Array.java:75) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3212) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3181) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.grow(ScheduledThreadPoolExecutor.java:921) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.offer(ScheduledThreadPoolExecutor.java:1014) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:1037) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:809) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.reExecutePeriodic(ScheduledThreadPoolExecutor.java:346) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:296) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-12-13 08:57:09.076 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.newArray(Native Method) ~[?:?]
at java.lang.reflect.Array.newInstance(Array.java:75) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3212) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3181) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.grow(ScheduledThreadPoolExecutor.java:921) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.offer(ScheduledThreadPoolExecutor.java:1014) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:1037) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:809) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.reExecutePeriodic(ScheduledThreadPoolExecutor.java:346) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:296) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-12-13 08:57:09.075 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.newArray(Native Method) ~[?:?]
at java.lang.reflect.Array.newInstance(Array.java:75) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3212) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3181) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.grow(ScheduledThreadPoolExecutor.java:921) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.offer(ScheduledThreadPoolExecutor.java:1014) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:1037) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:809) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:328) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay(ScheduledThreadPoolExecutor.java:597) ~[?:?]
at org.openhab.binding.deconz.internal.handler.DeconzBridgeHandler.startWebsocket(DeconzBridgeHandler.java:219) ~[?:?]
at org.openhab.binding.deconz.internal.handler.DeconzBridgeHandler$$Lambda$335/11365402.run(Unknown Source) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-12-13 08:57:09.074 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
After this I removed the deCONZ thing from config… and waited if the OOM happens without deCONZ:
Test without deconz Thing “openhab.log”:
2018-12-13 09:28:59.989 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2018-12-13 09:29:00.226 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2018-12-13 09:29:12.896 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2018-12-13 09:29:14.807 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.1.250:8080
2018-12-13 09:29:14.813 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.1.250:8443
2018-12-13 09:29:15.343 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
… wating … … no OOM …
Added deCONZ Software thing “events.log”:
2018-12-13 09:51:37.631 [hingStatusInfoChangedEvent] - 'deconz:deconz:34fcc13d' changed from UNINITIALIZED to INITIALIZING
2018-12-13 09:51:37.847 [me.event.ThingUpdatedEvent] - Thing 'deconz:deconz:34fcc13d' has been updated.
2018-12-13 09:51:38.175 [hingStatusInfoChangedEvent] - 'deconz:deconz:34fcc13d' changed from INITIALIZING to ONLINE
… waiting … … for round about 10 Minutes …
2018-12-13 10:00:00.122 [hingStatusInfoChangedEvent] - 'deconz:deconz:34fcc13d' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Idle timeout expired: 300000/300000 ms
2018-12-13 10:00:00.152 [hingStatusInfoChangedEvent] - 'deconz:deconz:34fcc13d' changed from OFFLINE (COMMUNICATION_ERROR): Idle timeout expired: 300000/300000 ms to OFFLINE (COMMUNICATION_ERROR): Idle Timeout
…
Same time in “openhab.log”:
2018-12-13 10:04:50.144 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.newArray(Native Method) ~[?:?]
at java.lang.reflect.Array.newInstance(Array.java:75) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3212) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3181) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.grow(ScheduledThreadPoolExecutor.java:921) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.offer(ScheduledThreadPoolExecutor.java:1014) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:1037) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:809) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.reExecutePeriodic(ScheduledThreadPoolExecutor.java:346) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:296) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-12-13 10:05:04.538 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.newArray(Native Method) ~[?:?]
at java.lang.reflect.Array.newInstance(Array.java:75) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3212) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3181) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.grow(ScheduledThreadPoolExecutor.java:921) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.offer(ScheduledThreadPoolExecutor.java:1014) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:1037) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:809) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.reExecutePeriodic(ScheduledThreadPoolExecutor.java:346) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:296) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-12-13 10:05:04.530 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
2018-12-13 10:04:42.896 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.newArray(Native Method) ~[?:?]
at java.lang.reflect.Array.newInstance(Array.java:75) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3212) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3181) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.grow(ScheduledThreadPoolExecutor.java:921) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.offer(ScheduledThreadPoolExecutor.java:1014) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:1037) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:809) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.reExecutePeriodic(ScheduledThreadPoolExecutor.java:346) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:296) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-12-13 10:04:50.144 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.newArray(Native Method) ~[?:?]
at java.lang.reflect.Array.newInstance(Array.java:75) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3212) ~[?:?]
at java.util.Arrays.copyOf(Arrays.java:3181) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.grow(ScheduledThreadPoolExecutor.java:921) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.offer(ScheduledThreadPoolExecutor.java:1014) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:1037) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.add(ScheduledThreadPoolExecutor.java:809) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.reExecutePeriodic(ScheduledThreadPoolExecutor.java:346) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:296) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-12-13 10:05:19.002 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
2018-12-13 10:05:33.103 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.OutOfMemoryError: Java heap space
Possible Solution
I am not sure where the OOM happens, but it only occures after activating the deconz binding… perhaps it always asks for the installed sensors but does not empty the Array? Actually I have paired 8 sensors which ar working in deCONZ or Phoscon App… and the REST API.
{
"1": {
"config": {
"configured": true,
"on": true,
"sunriseoffset": 30,
"sunsetoffset": -30
},
"etag": "4b4bb712ea71acf535d3f0d11225a3d0",
"manufacturername": "Philips",
"modelid": "PHDL00",
"name": "Daylight",
"state": {
"dark": false,
"daylight": true,
"lastupdated": "2018-12-13T08:27:44",
"status": 160
},
"swversion": "1.0",
"type": "Daylight",
"uniqueid": "00:21:2e:ff:ff:02:9d:9a-01"
},
"2": {
"config": {
"battery": 100,
"on": true,
"reachable": true,
"temperature": 1600
},
"ep": 1,
"etag": "df284b09ede31cdafb9553a554bbc12d",
"manufacturername": "LUMI",
"modelid": "lumi.sensor_magnet.aq2",
"name": "DoorWindowSensorXiaomi",
"state": {
"lastupdated": "2018-12-13T10:00:29",
"open": false
},
"type": "ZHAOpenClose",
"uniqueid": "00:15:8d:00:02:75:39:ba-01-0006"
},
"3": {
"config": {
"battery": 100,
"on": true,
"reachable": true,
"temperature": 1200
},
"ep": 1,
"etag": "d45b305db823c105f608a4deb6f4ba1a",
"manufacturername": "LUMI",
"mode": 1,
"modelid": "lumi.sensor_switch.aq2",
"name": "SwitchXiaomi",
"state": {
"buttonevent": 1002,
"lastupdated": "2018-12-07T17:36:28"
},
"type": "ZHASwitch",
"uniqueid": "00:15:8d:00:01:e8:31:b8-01-0006"
},
"4": {
"config": {
"battery": 81,
"on": true,
"reachable": true,
"temperature": 1200
},
"ep": 2,
"etag": "4f301c77305db826403fad4824e8e50b",
"manufacturername": "LUMI",
"mode": 1,
"modelid": "lumi.sensor_cube.aqgl01",
"name": "MagicubeXiaomi",
"state": {
"buttonevent": 1000,
"lastupdated": "2018-12-13T05:27:21"
},
"type": "ZHASwitch",
"uniqueid": "00:15:8d:00:02:7d:92:08-02-0012"
},
"5": {
"config": {
"battery": 78,
"offset": 0,
"on": true,
"reachable": true
},
"ep": 1,
"etag": "d6b65e1fa9b3c95d81f3170963665302",
"manufacturername": "LUMI",
"modelid": "lumi.weather",
"name": "TempHumidityPressureSensorXiaomi",
"state": {
"lastupdated": "2018-12-13T10:24:00",
"temperature": 1296
},
"type": "ZHATemperature",
"uniqueid": "00:15:8d:00:02:73:a5:64-01-0402"
},
"6": {
"config": {
"battery": 78,
"offset": 0,
"on": true,
"reachable": true
},
"ep": 1,
"etag": "d6b65e1fa9b3c95d81f3170963665302",
"manufacturername": "LUMI",
"modelid": "lumi.weather",
"name": "TempHumidityPressureSensorXiaomi",
"state": {
"humidity": 5352,
"lastupdated": "2018-12-13T10:24:00"
},
"type": "ZHAHumidity",
"uniqueid": "00:15:8d:00:02:73:a5:64-01-0405"
},
"7": {
"config": {
"battery": 78,
"on": true,
"reachable": true
},
"ep": 1,
"etag": "d6b65e1fa9b3c95d81f3170963665302",
"manufacturername": "LUMI",
"modelid": "lumi.weather",
"name": "TempHumidityPressureSensorXiaomi",
"state": {
"lastupdated": "2018-12-13T10:24:00",
"pressure": 1012
},
"type": "ZHAPressure",
"uniqueid": "00:15:8d:00:02:73:a5:64-01-0403"
},
"8": {
"config": {
"battery": 100,
"on": true,
"reachable": true,
"temperature": 1600,
"tholddark": 12000,
"tholdoffset": 7000
},
"ep": 1,
"etag": "aff8c7270f157ecefb905e20888f37e5",
"manufacturername": "LUMI",
"modelid": "lumi.sensor_motion.aq2",
"name": "MotionDetectorXiaomi",
"state": {
"dark": true,
"daylight": false,
"lastupdated": "2018-12-13T09:55:00",
"lightlevel": 7782,
"lux": 6
},
"type": "ZHALightLevel",
"uniqueid": "00:15:8d:00:02:c6:37:1d-01-0400"
}
}
Steps to Reproduce (for Bugs)
- Setup “openhab2” M8 or SNAPSHOT
- Install “deconz” binding
- Setup deconz thing (not found automatically, need manual setup, running on different raspberry)
- Wait for ~10 Minutes
Context
I want to setup an enviroment to extend the deconz bindung for different Xiaomi sensors paired with my Raspberry Pi. Actually I am using a second Raspberry for this, because my Raspberry with RaspBee connected is used for production.
Perhaps the issue is related to the network connection between Openhab DEV system with RaspBee binding and the Raspberry with deconz/RaspBee?
After the OOM happns the full OpenHAB WebGUI is frozen and does not respond anymore…
Your Environment
- Raspberry Pi 3 with OpenHAB 2.3 (Openhabian) and RaspBee with deconz 2.05.50 and Firmware 262F0500
- Second Raspberry Pi 3 (Raspbian strech, Zulu Embedded 8.25.0.76-linux-aarch32hf) for development with actual Openhab SNAPSHOT and only deCONZ binding installed
- All systems are on newest software stand.
- Both Raspberrys can access each other
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)

Top Related StackOverflow Question
Thanks, I will play around a little bit with the Pi’s 😃 and the OOM does definately not occure anymore!
Thanks and best regards!!!
@waywit I do not see any other resource leakage in the handler anymore. Test it without being authenticated and with a full working connection.
The bridge should be found automatically as long as your network doesn’t block broadcast UPNP packets. Broadcast only works in local subnets of course.
And my error description was not complete. If the bridge was authenticated the problem described could still happen if the websocket connection failed to establish. That was fixed as well with the referred commit.