Skip to content

Note the default GC latency mode#15760

Merged
gewarren merged 7 commits intodotnet:masterfrom
gewarren:gc-latency
Nov 13, 2019
Merged

Note the default GC latency mode#15760
gewarren merged 7 commits intodotnet:masterfrom
gewarren:gc-latency

Conversation

@gewarren
Copy link
Contributor

@gewarren gewarren commented Nov 8, 2019

Fixes #9739 .

gewarren added a commit to rpetrusha/docs that referenced this pull request Nov 8, 2019
gewarren pushed a commit that referenced this pull request Nov 9, 2019
* Documented additional GC switches

* Updated TOC

* Update docs/core/runtime-config/envvars.md

Co-Authored-By: Maira Wenzel <mairaw@microsoft.com>

* Update docs/core/runtime-config/index.md

Co-Authored-By: Maira Wenzel <mairaw@microsoft.com>

* remove changes that are taken care of by prs #15760 and #15761

* add new elements to index file and parent element table; toc improvements
@gewarren
Copy link
Contributor Author

@tdykstra Could you take a look since Bill is out?

Copy link
Contributor

@tdykstra tdykstra left a comment

Choose a reason for hiding this comment

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

A couple of questions.

# Latency modes

Latency refers to the time that the garbage collector intrudes in your application. During low latency periods, the garbage collector is more conservative and less intrusive in reclaiming objects. The <xref:System.Runtime.GCLatencyMode?displayProperty=nameWithType> enumeration provides two low latency settings:
To reclaim objects, the garbage collector (GC) must stop all the executing threads in an application. *Latency* refers to the time that the garbage collector intrudes in your application. In some situations, such as when an application retrieves data or displays content, a full garbage collection can occur at a critical time and impede performance. You can adjust the intrusiveness of the garbage collector by setting the <xref:System.Runtime.GCSettings.LatencyMode%2A?displayProperty=nameWithType> property to one of the <xref:System.Runtime.GCLatencyMode?displayProperty=nameWithType> values.
Copy link
Contributor

Choose a reason for hiding this comment

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

The "Latency refers to ..." sentence seems vague to me. I think your definition of "Low latency" under the following H2 is clearer and makes this sentence unnecessary.

|<xref:System.Runtime.GCLatencyMode.LowLatency>|For applications that have short-term, time-sensitive operations during which interruptions from the garbage collector could be disruptive. For example, applications that do animation rendering or data acquisition functions.|
|<xref:System.Runtime.GCLatencyMode.SustainedLowLatency>|For applications that have time-sensitive operations for a contained but potentially longer duration of time during which interruptions from the garbage collector could be disruptive. For example, applications that need quick response times as market data changes during trading hours.<br /><br /> This mode results in a larger managed heap size than other modes. Because it does not compact the managed heap, higher fragmentation is possible. Ensure that sufficient memory is available.|
|<xref:System.Runtime.GCLatencyMode.Batch>|For applications that have no user interface (UI) or server-side operations.<br /><br />This is the default mode for both server and workstation garbage collection when background garbage collection is disabled.|
|<xref:System.Runtime.GCLatencyMode.Interactive>|For most applications that have a UI.<br /><br />This is the default mode for workstation and server garbage collection for a standalone executable that's not hosted.<br /><br />This is the default mode for both server and workstation garbage collection when background garbage collection is enabled.|
Copy link
Contributor

Choose a reason for hiding this comment

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

Having the two "This is the default" lines is confusing, especially as they're out of sync in listing server and workstation in different orders. Does the first line now override the second line, i.e., even if background collection isn't enabled it's the default in the line 1 scenario?

Also, I presume if an app is "hosted," the GC setting of the hosting process takes precedence; if so should we explicitly state that?

@gewarren
Copy link
Contributor Author

@tdykstra Thanks for the review.

@gewarren gewarren merged commit bb11d5c into dotnet:master Nov 13, 2019
@gewarren gewarren deleted the gc-latency branch November 13, 2019 23:16
Youssef1313 pushed a commit to Youssef1313/docs that referenced this pull request Nov 20, 2019
* fixes dotnet#9739

* add in ron's changes from pr dotnet#12959

* feedback from tom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not clear what the default mode for Server GC is

4 participants