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

Connecting to Voice Channel Creates Memory Leaks #114

Closed
3 tasks done
robot-rover opened this issue Sep 13, 2016 · 2 comments
Closed
3 tasks done

Connecting to Voice Channel Creates Memory Leaks #114

robot-rover opened this issue Sep 13, 2016 · 2 comments
Labels
bug A general bug
Milestone

Comments

@robot-rover
Copy link
Contributor

Prerequisites

  • If this is a question/suggestion, I have already considered talking about it on the Discord4J server
  • This issue specifically has something to do with Discord4J
  • I have attempted to look for similar issues
    already

Description

When you connect to a voice channel it creates 9 threads that are never cleaned up.

Steps to Reproduce

  1. Connect to a voice channel
  2. Disconnect
  3. Measure the ammount of threads
  4. Repeat

TheIgloo has confirmed he is able to reproduce this

...

Expected behavior: When disconnecting from a voice channel the connection's threads are cleaned up.

Actual behavior: The threads are never cleaned up, not even when calling the Garbage Collector.

Stacktrace (if applicable): [PASTEBIN or HASTEBIN link to the stacktrace]
I made a bot to test this. It is a blank bot that simply connects to a voiceChannel, disconnects, and measures the amount of threads present 10 x, then measures the amount of threads every 15 seconds.
Here is the output: http://hastebin.com/ogixonadet.py
Version affected: Current Dev build

Additional Information

TheIgloo tested this as well and he found the same thing. I have also looked at the threads with VisualVM and they are infact at the levels that are being output.

@robot-rover robot-rover changed the title Connecting to Voice Channel Creates permanently running Threads Connecting to Voice Channel Creates Memory Leaks Sep 13, 2016
@austinv11 austinv11 added fixed bug A general bug labels Sep 13, 2016
@ArsenArsen
Copy link
Contributor

ArsenArsen commented Nov 28, 2016

I am pretty sure this is not fixed. After seeing thousands of threads on FlareBot I ran the same test. It quickly went over 500 threads. Here's that threaddump http://hastebin.com/miwaxuqona.pl

Affected version: websocket-rewrite

@robot-rover
Copy link
Contributor Author

Good so I'm not going insane then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants