-
-
Notifications
You must be signed in to change notification settings - Fork 985
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
Memory leak #40
Comments
Looking at BaseRTMPTConnection class: it uses LinkedBlockingQueue for outgoing messages and attemps to handle queue overflow gracefully by discarding messages. The problem is that LinkedBlockingQueue is created with default capacity, which is Integer.MAX_VALUE (2'147'483'647). I suppose this is too big and needs to be changed to a value that makes sense for Red5 default heap size of 768M. |
Sergey, thanks for the report and the plumbr details. I'll look at the latest code and see if the default size is still be used. |
For reference the class is now located in red5-server-common https://github.com/Red5/red5-server-common/blob/master/src/main/java/org/red5/server/net/rtmpt/BaseRTMPTConnection.java |
Fixed at commit Red5/red5-server-common@498780c |
Thanks a lot for quick response! Will this fix be included in then next Red5 release? Is there an approximate date for the next release? |
Yes, it'll be in the next release 1.0.4; which we are trying to get out before 2015. |
Great! Thanks again! |
We've configured red5 to leave memory dumps after OOM, here are the dumps that we got: 1 - https://drive.google.com/file/d/0B1vFExHovKwobllpNEt3Zk5RNTg/view?usp=sharing After analyzing the dumps with jvisualvm the following interesting facts we found: a) and b) together support a hypothesis, that in our case memory leak happens due to unclosed RTMPT connections. This raises 3 questions:
Thanks in advance! |
Did you use the patched / latest server build? On Wed Dec 24 2014 at 12:00:55 PM Sergey Smyshlyaev <
|
As for creating dumps automatically, I'd have to say no as it would cause confusion to the majority of users. I would however be glad to post a wiki page about it, if you want to write one up. |
Regarding server version, we are using 1.0.1. Was there any specific fix on RTMPT connections handling after 1.0.1? Anyway, I will try to reproduce the problem on a more recent version. What version would you recommend: 1.0.3 or 1.0.4-SNAPSHOT? Regarding memory dumps wiki page, I'll write one when I have time. What about monitoring RTMPT connections via JMX? I think it would be a valuable feature. |
We are running Red5 1.0.1 on Windows. In our setup it normally consumes about 300M of heap, but from time to time memory usage starts to grow and Red5 crashes with OutOfMemory exception.
We used a tool called Plumbr to analyze memory usage. Below are a couple of typical reports that we get from the tool in case of OOM:
https://portal.plumbr.eu/shared#/incident/188474?token=Hi5zH2LjgtLAqYdn5QezvzxSuEc
https://portal.plumbr.eu/shared#/incident/188457?token=ToJm7QFliYVZCU5ezNw_0NPuRnw
Please let me know, if you need any additional information.
The text was updated successfully, but these errors were encountered: