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

Remove explicit GC calls in the asset cache #73752

Merged
merged 4 commits into from
May 29, 2024

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented May 28, 2024

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.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 28, 2024 23:00
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 28, 2024
{
for (var i = 0; i < 3; i++)
GC.Collect();
}
Copy link
Member Author

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ForceGC();

I can do this in a separate PR, but it kinda bugs me that this has it's own dedicated thread for this. ABWQ usage would prevent the need for that, right?

Copy link
Contributor

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

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@CyrusNajmabadi CyrusNajmabadi merged commit d17bd36 into dotnet:main May 29, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 29, 2024
private static void ForceGC()
{
for (var i = 0; i < 3; i++)
GC.Collect();
Copy link
Member

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....

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants