You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In worst case, the current array pool policies may send you on a death spiral above 70% memory utilization: The array pool will start flushing itself after every Gen2 GC, that produces a lot of garbage that needs to be collected, that triggers more GCs, that causes more trimming, …
I'm not sure what we can do here in a "global" sense. If the GC is under significant pressure the ArrayPool rooting a bunch of otherwise unrooted objects can kill performance or lead to OOM conditions as well. Adding the collection under pressure logic had a significant positive impact.
You can already create your own private pool, which doesn't collect (i.e. ArrayPool<T>.Create()), is that enough to address the concern here?
We're already doing some logic to favor larger arrays. We could try to add more logic to tweak our aggressiveness, but I worry about unintended consequences. Not saying that we shouldn't do anything, I'm just voicing my concerns. I'd love to see more detailed scenarios.
@Maoni0 do you have any suggestions on how to play nicer with the GC?
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.
Activity
jkotas commentedon Aug 8, 2019
In worst case, the current array pool policies may send you on a death spiral above 70% memory utilization: The array pool will start flushing itself after every Gen2 GC, that produces a lot of garbage that needs to be collected, that triggers more GCs, that causes more trimming, …
stephentoub commentedon Aug 21, 2019
@jeffschwMSFT, why did you move this issue to corefx? The ArrayPool implementation is in coreclr.
jeffschwMSFT commentedon Aug 21, 2019
@stephtoub my mistake... moving it back :)
stephentoub commentedon Aug 21, 2019
😄 (single repo for the win)
JeremyKuhne commentedon Aug 21, 2019
I'm not sure what we can do here in a "global" sense. If the GC is under significant pressure the
ArrayPoolrooting a bunch of otherwise unrooted objects can kill performance or lead to OOM conditions as well. Adding the collection under pressure logic had a significant positive impact.You can already create your own private pool, which doesn't collect (i.e.
ArrayPool<T>.Create()), is that enough to address the concern here?We're already doing some logic to favor larger arrays. We could try to add more logic to tweak our aggressiveness, but I worry about unintended consequences. Not saying that we shouldn't do anything, I'm just voicing my concerns. I'd love to see more detailed scenarios.
@Maoni0 do you have any suggestions on how to play nicer with the GC?
jkotas commentedon Aug 22, 2019
That does not help. Close to none of the APIs that use ArrayPool as implementation detail take a custom array pool as an input.
VSadov commentedon Aug 23, 2019
Perhaps when trimming due to pressure, the pool size should be temporarily reduced?
Like:
MaxBuffersPerArraySizePerCoreand use that for how much can actually be retained.MaxBuffersPerArraySizePerCoreevery time you survive Gen2 without a need to trim.Just a thought...
joperezr commentedon Aug 27, 2019
@jkotas I suppose this is not new for 3.0 or a regression right? I just ask because I was about to triage this as Future but wanted to double check.
jkotas commentedon Aug 27, 2019
Correct. This is not a regression.
dotnet-policy-service commentedon Jan 2, 2025
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This process is part of our issue cleanup automation.
dotnet-policy-service commentedon Jan 16, 2025
This issue will now be closed since it had been marked
no-recent-activitybut received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.