What version of gRPC are you using?
- google.golang.org/grpc v1.73.0
- google.golang.org/protobuf v1.36.6
What version of Go are you using (go version)?
- go version go1.24.4 linux/amd64
What operating system (Linux, Windows, …) and version?
What did you do?
Returning grpc unary response objects that are ever increasing in sizes causes the simple buffer pool to keep allocating buffers and never free old ones. (see attached test)
What did you expect to see?
- simple buffer pool free's buffers if it has too many pending buffers
- simple buffer pool allocates buffers rounding up size to nearest 512 bytes to encourage re-use
- option to use
NopBufferPool instead of simpleBufferPool once exceeding tiered pool size
What did you see instead?
GC thrashing and eventual oom
Test that causes the bad behavior
https://gist.github.com/mchandler-plato/61fb18e770a9a9db78ddd6a14a88c13a
What version of gRPC are you using?
What version of Go are you using (
go version)?What operating system (Linux, Windows, …) and version?
What did you do?
Returning grpc unary response objects that are ever increasing in sizes causes the simple buffer pool to keep allocating buffers and never free old ones. (see attached test)
What did you expect to see?
NopBufferPoolinstead ofsimpleBufferPoolonce exceeding tiered pool sizeWhat did you see instead?
GC thrashing and eventual oom
Test that causes the bad behavior
https://gist.github.com/mchandler-plato/61fb18e770a9a9db78ddd6a14a88c13a