-
Notifications
You must be signed in to change notification settings - Fork 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
Remove explicit GC calls in the asset cache #73752
Conversation
{ | ||
for (var i = 0; i < 3; i++) | ||
GC.Collect(); | ||
} |
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.
this is a move of waht the product code used to do. i moved it here so test code dosen't have to update.
@@ -138,42 +115,10 @@ private async Task CleanAssetsAsync() | |||
while (!cancellationToken.IsCancellationRequested) | |||
{ | |||
await CleanAssetsWorkerAsync(cancellationToken).ConfigureAwait(false); | |||
|
|||
ForceGC(); |
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.
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.
Never mind, expanded my search and there are other activities on this thread
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.
private static void ForceGC() | ||
{ | ||
for (var i = 0; i < 3; i++) | ||
GC.Collect(); |
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.
If this is being used for testing it's odd it isn't doing the WaitForPendingFinalizers that is often used....
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.
Yes. thsi is very odd.
This is a holdover from our 32bit days where we needed to be much more aggressive about relinquishing memory. We do not need that now, and we want to let the normal GC do its thing.