grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

mem: use slice capacity instead of length, to determine whether to pool buffers or directly allocate them

Open PapaCharlie opened this issue 1 year ago • 3 comments

Fixes #7631

As the issue states, mem.NewBuffer would not pool buffers with a length below the pooling threshold but whose capacity is actually larger than the pooling threshold. This can lead to buffers being leaked.

RELEASE NOTES:

  • mem: use slice capacity instead of length, to determine whether to pool buffers or directly allocate them

PapaCharlie avatar Oct 04 '24 18:10 PapaCharlie