ObjectDecoder extends LengthFieldBasedFrameDecoder , which continues to FrameDecoder . FrameDecoder controls the decoding buffer and uses a dynamic buffer with an initial capacity of 256 .
However, as soon as you get a large object, the dynamic buffer expands, but never shrinks. If you have several connections that exchange large objects, your ObjectDecoder will have a very large buffer in the long run, which potentially leads to an OutOfMemoryError .
This problem was fixed last week, and a new version (3.2.7.Final) will be released this week.
source share