Description
This issues addresses bullet point 5 from #5751.
We currently allocate a static buffer which is twice the size configured by the user. This buffer ends up using a bunch of memory, even when not being actively used.
Some options to consider:
- Dynamically tune buffer size based on activity
- Use a
sync.Pool
and keep a bunch of buffers around and manage the number (and possibly size) of these buffers based on activity
We should be able to use the changes made as part of #5757 to test the effectiveness of these options.