Repository navigation
Garbage Collection Steering during block processing - #5504
Conversation
This reverts commit 413377e.
Co-authored-by: Ben Adams <[email protected]>
reduces default GC generation to 1, renames
Allow compacting LOH, Add constants
Decrease the delays to 100ms Only force GC when LatencyMode is not NoGCRegion
52ff6b0 to
8b06175
Compare
|
@benaadams that aggressive doesn't seem to change much: |
Total memory goes down rather than locking at max level |
| [ConfigItem(Description = "Reduces memory usage by forcing Garbage Collection between EngineApi calls. Accept values `NoGc` (-1), Gen0 (0), Gen1 (1), Gen2 (2).", DefaultValue = "Gen1")] | ||
| public GcLevel SweepMemory { get; set; } | ||
|
|
||
| [ConfigItem(Description = "Reduces process used memory. Accept values `No` which disables it, `Yes` which compacts normal heaps, `Full` compacts large object heap too (only when SweepMemory is set to `Gen2`).", DefaultValue = "Yes")] |
There was a problem hiding this comment.
@benaadams @LukaszRozmej cosmetic thing. Do you think that "Merge" section is the best for having such config options?
There was a problem hiding this comment.
Probably should be in a GC section? 🤔
There was a problem hiding this comment.
So the answer is yes and no. No it is not the best as there is little connection between merge and GC by itself. Yes because what we are optimizing is based on EngineAPI and it is not applicable anything outside the merge.
So it is little confusing we have this settings under merge, but if we had them elsewhere it would be confusing for users on some other networks.
I am open to suggestions how to handle it better.
| size ??= _defaultSize; | ||
| var priorLatencyMode = System.Runtime.GCSettings.LatencyMode; | ||
| //if (_gcStrategy.CanStartNoGCRegion()) | ||
| if (priorLatencyMode != GCLatencyMode.SustainedLowLatency) |
There was a problem hiding this comment.
We could have some strategies here:
- NoGCRegionStrategy
- SustainedLowLatencyStrategy
and invoke one or the other - or both!
There was a problem hiding this comment.
Sounds like follow up post bug?
|
Let's do this so can run for a while in master. All credit to @LukaszRozmej for this change; is making a huge difference in what I'm seeing for memory management |
|
Reference to issue dotnet/runtime#84096 preventing NoGCRegion and fix in progress dotnet/runtime#82045 |

Changes
Interim version of #5381
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?