You need to call ((ByteBuf) msg).release() before you break to not introduce a buffer leak here.