Description
When pooled ByteBuffers are used in conjunction with a ProtocolCodecFilter, buffers passed to ProtocolEncoderOutput.write() do not get released back to the pool in all circumstances, causing unnecessary memory allocation.
The following patch appears to resolve this issue in a simple filter chain, but it should be verified that there is no case where this change would cause a buffer to be released too early.
Best regards,
Greg
Index: core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
===================================================================
— core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java (revision 657929)
+++ core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java (working copy)
@@ -186,6 +186,10 @@
public void messageSent(NextFilter nextFilter, IoSession session,
Object message) throws Exception {
if (message instanceof HiddenByteBuffer)