[#1763] Fill ChannelOutboundBuffer.nioBuffers with null on close to allow the content to be GC'ed

This commit is contained in:
Norman Maurer 2013-08-20 21:15:05 +02:00
parent 15cfa47ad9
commit 217b8e255c

View File

@ -30,6 +30,7 @@ import io.netty.util.internal.logging.InternalLoggerFactory;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
@ -463,6 +464,10 @@ public final class ChannelOutboundBuffer {
} finally {
tail = unflushed;
inFail = false;
// null out the nio buffers array so the can be GC'ed
// https://github.com/netty/netty/issues/1763
Arrays.fill(nioBuffers, null);
}
RECYCLER.recycle(this, handle);