Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JdkZlibEncoder can use pooled heap buffers for deflater input (#11891)
Motivation: Previously, when the input ByteBuf was not heap allocated we copied the input into a new byte array allocated on the heap for every encode() call. This puts high-throughput clients that use the JdkZlibEncoder under memory pressure. Modifications: Now, when the input ByteBuf is not heap allocated we copy the input into a heap ByteBuf allocated from the configured ByteBufAllocator (which might be pooled), releasing it after the encode() has completed. Result: The result is less heap allocation and GC activity when the PooledByteBufAllocator is used (which is the default) Fixes #11890 Signed-off-by: Daniel Ferstay <dferstay@splunk.com> Co-authored-by: Daniel Ferstay <dferstay@splunk.com> Co-authored-by: Norman Maurer <norman_maurer@apple.com>
- Loading branch information