netty/netty — pull request #280 by normanmaurer (2012-04-23 11:21:05+00:00)
Title: Cumulation optimization

This changes try to minimize the size of the cumulation buffer to a minimum. Before we used a DynamicChannelBuffer which was never "shrinked" again. The problem with the previous implementation was that it could lead to very big cumulation buffers.

For example if you receive a buffer with 65k it will create a cumulation buffer with min. 65k + whatsleft. If you are lucky enough you will even get a cumulation buffer of 2 * 65k as the DynamicChannelBuffer will double its size if it needs more room.

The changes here try to fix it.

@trustin please review