dotnet / dotnet/AspNetCore.Docs

Seemingly inconsistent server/workstation garbage collection documentation

Open
#26,110 1 comment 0 reactions 1 assignee Claimed by @wadepickett View on GitHub
gRPC Source - Docs.ms
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

Description

From [this article](https://docs.microsoft.com/en-us/aspnet/core/grpc/performance?view=aspnetcore-6.0#servergarbagecollection-in-client-apps)...

> ASP.NET Core apps use **server** GC by **default**.

Seems to be contradicted by [this](https://docs.microsoft.com/en-us/dotnet/core/runtime-config/garbage-collector#workstation-vs-server)...

> **Default**: **Workstation** garbage collection. This is equivalent to setting the value to **false**.

Which [this answer](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.gcsettings.isservergc?view=net-6.0#system-runtime-gcsettings-isservergc) supports...

> If server garbage collection is not enabled, **workstation** garbage collection **is in effect** (with or without concurrent collection).

However...

```
dotnet new web -o web
cd web
dotnet build
Get-Content .\bin\Debug\net6.0\*runtime*.json | Select-String -Pattern GC
```

...shows...

`"System.GC.Server": true`,

FWIW, in my dotnet core 3.1 project, editing the csproj to set [ServerGarbageCollection](https://docs.microsoft.com/en-us/aspnet/core/performance/memory?view=aspnetcore-6.0#workstation-gc-vs-server-gc) to false, does result in both `"System.GC.Server": false,` in the generated runtime json file and gives the [expected result](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.gcsettings.isservergc?view=net-6.0#examples) in `System.Runtime.GCSettings.IsServerGC` during runtime.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 484737e7-abb8-c142-35f8-22a35817270d
* Version Independent ID: 9e412677-c511-9f5b-4654-95e0177c7dd4
* Content: [Performance best practices with gRPC](https://docs.microsoft.com/en-us/aspnet/core/grpc/performance?view=aspnetcore-6.0)
* Content Source: [aspnetcore/grpc/performance.md](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/grpc/performance.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-grpc**
* GitHub Login: @JamesNK
* Microsoft Alias: **jamesnk**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.