Skip to content

Garbage Collection Steering during block processing - #5504

Merged
benaadams merged 36 commits into
masterfrom
new-payload-SustainedLowLatency
Mar 31, 2023
Merged

benaadams merged 36 commits into
masterfrom
new-payload-SustainedLowLatency

Conversation

@benaadams

Copy link
Copy Markdown
Member

Changes

  • Switch to SustainedLowLatency during NewPayload

Interim version of #5381

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

@LukaszRozmej LukaszRozmej mentioned this pull request Mar 28, 2023
3 of 12 tasks
@benaadams
benaadams force-pushed the new-payload-SustainedLowLatency branch from 52ff6b0 to 8b06175 Compare March 29, 2023 23:55
@LukaszRozmej

Copy link
Copy Markdown
Member

@benaadams that aggressive doesn't seem to change much:

image

@benaadams

Copy link
Copy Markdown
Member Author

@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")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@benaadams @LukaszRozmej cosmetic thing. Do you think that "Merge" section is the best for having such config options?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Probably should be in a GC section? 🤔

@LukaszRozmej LukaszRozmej Mar 31, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could have some strategies here:

  1. NoGCRegionStrategy
  2. SustainedLowLatencyStrategy

and invoke one or the other - or both!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sounds like follow up post bug?

@benaadams

Copy link
Copy Markdown
Member Author

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

@benaadams
benaadams merged commit 6bab84a into master Mar 31, 2023
@benaadams
benaadams deleted the new-payload-SustainedLowLatency branch March 31, 2023 11:48
@benaadams benaadams changed the title New payload sustained low latency Garbage Collection Steering during block processing Mar 31, 2023
@benaadams

Copy link
Copy Markdown
Member Author

Reference to issue dotnet/runtime#84096 preventing NoGCRegion and fix in progress dotnet/runtime#82045

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants