Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[miio] OutOfMemory errors due to threads being continuously created #8091

Closed
kaikreuzer opened this issue Jul 9, 2020 · 7 comments
Closed
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@kaikreuzer
Copy link
Member

I am seeing regular OOM errors on my instance and just had a look at the thread dump. What I am seeing is that the MI IO binding seems to be the culprit as it creates hundreds of threads:

"Mi IO MessageSenderThread" #40012 daemon prio=5 os_prio=31 tid=0x00007fb1ebca2000 nid=0x4aa67 waiting on condition [0x000070001ff01000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39931 daemon prio=5 os_prio=31 tid=0x00007fb1ec60e800 nid=0x44bd3 waiting on condition [0x000070002329a000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39843 daemon prio=5 os_prio=31 tid=0x00007fb1ec428000 nid=0x4b283 sleeping[0x000070001fdfe000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39711 daemon prio=5 os_prio=31 tid=0x00007fb1f3335000 nid=0x4e697 waiting on condition [0x000070002236d000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39616 daemon prio=5 os_prio=31 tid=0x00007fb1edc17800 nid=0x4abc7 waiting on condition [0x0000700023197000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39543 daemon prio=5 os_prio=31 tid=0x00007fb1ee94b800 nid=0x427db waiting on condition [0x0000700022779000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39465 daemon prio=5 os_prio=31 tid=0x00007fb1eeb4a800 nid=0x2eacb waiting on condition [0x0000700020b25000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39321 daemon prio=5 os_prio=31 tid=0x00007fb1f3668800 nid=0x4d58f sleeping[0x0000700021c58000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39212 daemon prio=5 os_prio=31 tid=0x00007fb1ef47b000 nid=0x3e8df waiting on condition [0x0000700020719000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39129 daemon prio=5 os_prio=31 tid=0x00007fb1ec0c3800 nid=0x4037f sleeping[0x0000700020004000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #39032 daemon prio=5 os_prio=31 tid=0x00007fb1f33fe800 nid=0x4787b sleeping[0x000070002020a000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #38909 daemon prio=5 os_prio=31 tid=0x00007fb1ef6a5800 nid=0x49d43 waiting on condition [0x0000700020e2e000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #38809 daemon prio=5 os_prio=31 tid=0x00007fb1ed889800 nid=0x4da17 waiting on condition [0x0000700021a52000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #38725 daemon prio=5 os_prio=31 tid=0x00007fb1ef260000 nid=0x3fa0b sleeping[0x000070002123a000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #38626 daemon prio=5 os_prio=31 tid=0x00007fb1f196c800 nid=0x4336b waiting on condition [0x000070001d380000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #38507 daemon prio=5 os_prio=31 tid=0x00007fb1ed9c7000 nid=0x49947 waiting on condition [0x000070002226a000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #38396 daemon prio=5 os_prio=31 tid=0x00007fb1f026b000 nid=0x4a4bb waiting on condition [0x000070001c85f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)

"Mi IO MessageSenderThread" #38328 daemon prio=5 os_prio=31 tid=0x00007fb1f04d0800 nid=0x44973 waiting on condition [0x000070002184c000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication$MessageSenderThread.run(MiIoAsyncCommunication.java:225)
...
@kaikreuzer kaikreuzer added the bug An unexpected problem or unintended behavior of an add-on label Jul 9, 2020
@lolodomo
Copy link
Contributor

lolodomo commented Jul 9, 2020

I fixed one memory leak in this binding with #7607
Either this fix was overwritten or there are other leaks in the binding.

@kaikreuzer
Copy link
Member Author

Thanks, the report #7583 indeed looks pretty much the same.
The bad news is that it does not seem to be fixed by #7607.
My system is running a build from May 27, so the fix should be included there already.

marcelrv added a commit to marcelrv/openhab-addons that referenced this issue Jul 24, 2020
Fix Max Datagram connections reached issue
Possibly also addressing openhab#8091 as exception during closing would prevent
thread closing

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
fwolter pushed a commit that referenced this issue Jul 26, 2020
Fix Max Datagram connections reached issue
Possibly also addressing #8091 as exception during closing would prevent
thread closing

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
MPH80 pushed a commit to MPH80/openhab-addons that referenced this issue Aug 3, 2020
Fix Max Datagram connections reached issue
Possibly also addressing openhab#8091 as exception during closing would prevent
thread closing

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
Signed-off-by: MPH80 <michael@hazelden.me>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
Fix Max Datagram connections reached issue
Possibly also addressing openhab#8091 as exception during closing would prevent
thread closing

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
Fix Max Datagram connections reached issue
Possibly also addressing openhab#8091 as exception during closing would prevent
thread closing

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
Fix Max Datagram connections reached issue
Possibly also addressing openhab#8091 as exception during closing would prevent
thread closing

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
Fix Max Datagram connections reached issue
Possibly also addressing openhab#8091 as exception during closing would prevent
thread closing

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this issue Sep 1, 2020
Fix Max Datagram connections reached issue
Possibly also addressing openhab#8091 as exception during closing would prevent
thread closing

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this issue Sep 19, 2020
Fix Max Datagram connections reached issue
Possibly also addressing openhab#8091 as exception during closing would prevent
thread closing

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
@marcelrv
Copy link
Contributor

@kaikreuzer do you still experience the issue or did #8189 fix it?

@kaikreuzer
Copy link
Member Author

@marcelrv I just had my system running into OOMs and found hundreds of MIIO threads:

Screenshot 2021-10-22 at 23 26 43

Looks like my originally reported issue - so this still occurs.

@marcelrv
Copy link
Contributor

Which version are you using? Is it including pr's from 8 Sep? (#11166) as that would help narrow down what specific conditions create the issue

@kaikreuzer
Copy link
Member Author

I was running 3.2.0 M3, so yes, #11166 was included.

@kaikreuzer
Copy link
Member Author

Thanks for fixing - I'll keep checking my system and if you don't hear back from me on it, you can consider it solved. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

3 participants