Amazon Echo Control Binding causing "OutOfMemoryError: unable to create new native thread"

Hi,

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?

Please use the search function. This has been reported before and is fixed in 2.5.6.

Welcome to the Community!

As mentioned this has been fix in the latest update of OH. If you prefer not to update OH then you can uninstall the binding via PaperUI and install the snapshot jar file in /usr/share/openhab2/addons then restart OH.

Link to latest snapshot jar file:
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/addons/bundles/org.openhab.binding.amazonechocontrol/2.5.7-SNAPSHOT/

Thanks for the help and link! I already searched for the updated version without success and then decided to upgrade the whole OpenHab instance to 2.5.6. This seems to have fixed the issue.

Glad you got it working. :+1:

Please click the square box on the post that provided the solution to mark the topic as solved.

Thanks