-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mem: use slice capacity instead of length, to determine whether to pool buffers or directly allocate them #7702
Conversation
1ab352d
to
5d2cb0c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7702 +/- ##
==========================================
- Coverage 81.80% 81.32% -0.49%
==========================================
Files 361 368 +7
Lines 27827 36772 +8945
==========================================
+ Hits 22765 29906 +7141
- Misses 3861 5636 +1775
- Partials 1201 1230 +29
|
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.
5d2cb0c
to
aed354b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo minor nits.
…ol buffers or directly allocate them (grpc#7702) * Address grpc#7631 by correctly pooling large-capacity buffers 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. --------- Co-authored-by: Purnesh Dixit <purneshdixit@google.com> Co-authored-by: Easwar Swaminathan <easwars@google.com>
…ol buffers or directly allocate them (grpc#7702) * Address grpc#7631 by correctly pooling large-capacity buffers 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. --------- Co-authored-by: Purnesh Dixit <purneshdixit@google.com> Co-authored-by: Easwar Swaminathan <easwars@google.com>
…ol buffers or directly allocate them (grpc#7702) * Address grpc#7631 by correctly pooling large-capacity buffers 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. --------- Co-authored-by: Purnesh Dixit <purneshdixit@google.com> Co-authored-by: Easwar Swaminathan <easwars@google.com>
…ol buffers or directly allocate them (grpc#7702) * Address grpc#7631 by correctly pooling large-capacity buffers 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. --------- Co-authored-by: Purnesh Dixit <purneshdixit@google.com> Co-authored-by: Easwar Swaminathan <easwars@google.com>
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: