May be this exceptions lead to memory leak? I found them in my log.
Also I found in profiler than org.red5.server.net.rtmpt.
RTMPTConnection instances are never terminated after I close flash player or close browser tab. Their count grows.org.red5.server.net.protocol.
ProtocolException: Error during decoding
at org.red5.server.net.rtmp.
codec.RTMPProtocolDecoder.
decode(RTMPProtocolDecoder.
java:195) ~[red5-server-1.0.jar:na]
at org.red5.server.net.rtmp.
codec.RTMPProtocolDecoder.
decodeBuffer(
RTMPProtocolDecoder.java:116) ~[red5-server-1.0.jar:na]
at org.red5.server.net.rtmpt.
BaseRTMPTConnection.decode(
BaseRTMPTConnection.java:195) ~[red5-server-1.0.jar:na]
at org.red5.server.net.rtmpt.
RTMPTServlet.handleSend(
RTMPTServlet.java:336) ~[red5-server-1.0.jar:na]
at org.red5.server.net.rtmpt.
RTMPTServlet.service(
RTMPTServlet.java:419) ~[red5-server-1.0.jar:na]
at javax.servlet.http.
HttpServlet.service(
HttpServlet.java:717) ~[javaee-api-5.1.2.jar:5.1.2]
at org.apache.catalina.core.
ApplicationFilterChain.
internalDoFilter(
ApplicationFilterChain.java:
290) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.
ApplicationFilterChain.
doFilter(
ApplicationFilterChain.java:
206) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.
StandardWrapperValve.invoke(
StandardWrapperValve.java:233) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.
StandardContextValve.invoke(
StandardContextValve.java:191) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.
authenticator.
AuthenticatorBase.invoke(
AuthenticatorBase.java:470) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.
StandardHostValve.invoke(
StandardHostValve.java:127) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.valves.
ErrorReportValve.invoke(
ErrorReportValve.java:103) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.valves.
AccessLogValve.invoke(
AccessLogValve.java:615) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.
StandardEngineValve.invoke(
StandardEngineValve.java:109) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.connector.
CoyoteAdapter.service(
CoyoteAdapter.java:293) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.coyote.http11.
Http11NioProcessor.process(
Http11NioProcessor.java:891) ~[tomcat-coyote-6.0.36.jar:6.
0.36]
at org.apache.coyote.http11.
Http11NioProtocol$
Http11ConnectionHandler.
process(Http11NioProtocol.
java:750) ~[tomcat-coyote-6.0.36.jar:6.
0.36]
at org.apache.tomcat.util.net.
NioEndpoint$SocketProcessor.
run(NioEndpoint.java:2282) ~[tomcat-coyote-6.0.36.jar:6.
0.36]
at java.util.concurrent.
ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1145) ~[na:1.7.0_25]
at java.util.concurrent.
ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:615) ~[na:1.7.0_25]
at java.lang.Thread.run(Thread.
java:724) ~[na:1.7.0_25]
Caused by: java.lang.
IllegalStateException: Invalid RTMP state: 5, nothing to decode
at org.red5.server.net.rtmp.
codec.RTMPProtocolDecoder.
decode(RTMPProtocolDecoder.
java:189) ~[red5-server-1.0.jar:na]
… 21 common frames omitted
java.lang.NullPointerException: null
at org.red5.server.net.rtmpt.BaseRTMPTConnection.read(BaseRTMPTConnection.java:204) ~[red5-server-1.0.jar:na]
at org.red5.server.net.rtmpt.RTMPTServlet.handleSend(RTMPTServlet.java:341) ~[red5-server-1.0.jar:na]
at org.red5.server.net.rtmpt.RTMPTServlet.service(RTMPTServlet.java:419) ~[red5-server-1.0.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) ~[javaee-api-5.1.2.jar:5.1.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) ~[catalina-6.0.36.jar:6.0.36]
at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:891) ~[tomcat-coyote-6.0.36.jar:6.0.36]
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:750) ~[tomcat-coyote-6.0.36.jar:6.0.36]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2282) ~[tomcat-coyote-6.0.36.jar:6.0.36]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]