recently I have been getting issues with my OpenHab instance which is caused by too many threads being created. For example:
2020-06-15 05:49:03.386 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ende with an exception: java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start0(Native Method) ~[?:1.8.0_222] at java.lang.Thread.start(Thread.java:717) ~[?:1.8.0_222] at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957) ~[?:1.8.0_222] at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1603) ~[?:1.8.0_222] at java.util.concurrent.ScheduledThreadPoolExecutor.reExecutePeriodic(ScheduledThreadPoolExecutor.java:350) ~[?:1.8.0_222] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:296) ~[?:1.8.0_222] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
To narrow down the issue I started disabling bindings and found out that the number of threads stops increasing (after openhab restart) when the Amazon Echo Control (version 2.5.5) binding is disabled, so I assume that it’s the cause.
The binding worked fine without issues for a few weeks before this problem started to occur and I am not aware of any notable changes to my OpenHab configuration.
I also have a full thread dump (OpenHab running for approx. 1h) available here: https://pastebin.com/jp1qLuPi
Any ideas how to solve this issue?