Skip to content
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

sync: Pool releasing items too quickly #44744

Closed
pjebs opened this issue Mar 2, 2021 · 2 comments
Closed

sync: Pool releasing items too quickly #44744

pjebs opened this issue Mar 2, 2021 · 2 comments

Comments

@pjebs
Copy link
Contributor

pjebs commented Mar 2, 2021

On GC, the Pool is releasing too many items which I believe should be retained significantly longer.
The creation of said item (via New) is a time-consuming process for me so it's defeating the purpose of using the Pool to improve latency.

This is a revisit of: #22950

It would be great if there was an option or a way for us to customize different strategies on when the Pool should release items.

@ianlancetaylor
Copy link
Contributor

A sync.Pool is not meant to serve all purposes. If it is costly to create new items, it's often best to maintain your own free list rather than to use a sync.Pool.

@randall77
Copy link
Contributor

randall77 commented Mar 2, 2021

Could you describe your use behavior? Why is CL 166961 not enough?

@pjebs pjebs closed this as completed Mar 3, 2021
@golang golang locked and limited conversation to collaborators Mar 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants