"The garbage collector is self-tuning and can work in a wide variety of scenarios. You can use a configuration file setting to set the type of garbage collection based on the characteristics of the workload"
You're saying it's self-tuning, immediately followed by 'set it yourself'. Does an application without a setting for <gcServer> automatically switch between workstation and server modes as part of the self-tuning? If so it means that performance should gradually reach its optimum level, but if not it could be a costly mistake to omit it.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for submitting your questions, @ro-jo.
@maioni0, can you answer @ro-jo's questions? And do we need to provide some additional detail in the documentation about what self-tuning means and when adding or modifying the
@ro-jo asks a reasonable question but somehow no one ever responded to @rpetrusha's urging about it. @maioni0 or others?
@ro-jo
IIUC,
Server GC is not the default and must be opted into. Once an application is started with either a Server or Workstation GC, it cannot be changed during the application's lifetime.
The self tuning aspects of the GC refer to collection timing and aggressiveness which enables the GC to deliver good performance across many types of workloads.
@rpetrusha I think you meant to call @Maoni0 instead of @maioni0
~That being said, the doc could include a paragraph explaining that:~
Edit
Nevermind, Maoni0 has spoken.
well, I dunno who @maioni0 is and not sure why they didn't respond. and I don't normally read the docs repo so the only way that I would know about an issue in this repo that requires my attention is if someone mentions @Maoni0.
@ro-jo
You're saying it's self-tuning, immediately followed by 'set it yourself'.
"self-tuning" and "set it yourself" refer to different things.
"set if yourself" is referring to setting configs that do not require users to have GC internal knowledge. for example, the kinds of workloads meaning "are you a process that tends to coexist with many other processes on the machine and does fairly irregular things(Workstation like workload), or a dominant/very active process that does fairly regular things (Server like workload)". it should be a simply decision on the users side.
self-tuning means for the kind of workload GC does not require you to tell it what GC mechanism to use, eg, you don't need to tell the GC things like "compact the heap when the free ratio is > X%" or "use this GC for young generation collections and this other one for old gen".
does this help?
Sorry about that, @Maoni0. I mistyped your GitHub alias.
@ro-jo
The GC mode can't be changed after the application has started. It's used to categorize the workload on the machine. Generally it should be Server if it's the only program running and Workstation if it's running along with other programs. The application has no idea about the environment and relies on you to tell the program how it's deployed. That's why it's a setting that you must configure.
Once the basic workload type is set, the GC can then use that as a guide and optimize itself as the program runs to ensure collection keeps pace with allocation and pauses are as small as possible. There are internal settings that the GC will "self-tune" but you can still override if you really need to.
That's really it. There's 1 big setting in terms of what environment the app is running in, and then the GC does the rest automatically.
The difference in GC modes is clearly described in the existing documentation if you read past the single sentence you take issue with.
It comes down to how resource-intensive the GC should be, which is up to you to decide if you're running many other applications on the same server. I'm not sure how you expect the program to know these kinds of details automatically, and it's no different than how an OS provides CPU affinity and process priority for you to control resources. If you need a middle-ground then stick with Workstation, which is the default anyway.
Regardless, we can't read your mind and your responses show both confusion and disagreement as if you know better so I'm not sure what you were expecting. Your attitude is definitely not conducive to getting any help though. Good luck to you.
@manigandham It's almost as if you haven't read anything I've written.
Look at your answers and then the original question.
The only place I go for help is stackoverflow, so no big deal, it sticks to answering the question and context.
I regret commenting on this thread.
And for context, I don't work for Microsoft.
@ro-jo, participation in the dotnet/docs repo is governed by the .NET Foundation code of conduct. Your insulting tone and generally derogatory comments fall well short of the level of civility and respect for others that we expect from participants.
@rpetrusha thanks, I totally agree with you, my comments were unacceptable. Deleted the offending material, apologies all round to those I offended.
Thank you, @ro-jo, for your response and apology. We look forward to your continuing interest in our documentation and participation in our GitHub repos.