Skip to content

Add profileSingleIteration option to dotMemory/dotTrace diagnosers - #3334

Merged
timcassell merged 1 commit into
dotnet:masterfrom
reabr:fix/2628-dotmemory-dottrace-single-iteration
Nov 15, 2026
Merged

timcassell merged 1 commit into
dotnet:masterfrom
reabr:fix/2628-dotmemory-dottrace-single-iteration

Conversation

@reabr

@reabr reabr commented Nov 14, 2026

Copy link
Copy Markdown
Contributor
  • Add an opt-in profileSingleIteration option (default: false) to DotMemoryDiagnoser, DotTraceDiagnoser and their attributes.
  • When enabled, SnapshotProfilerBase returns RunMode.ExtraIteration and starts/stops the profiler on BeforeExtraIteration / AfterExtraIteration instead of BeforeActualRun / AfterActualRun. The snapshot then covers a single iteration only.
  • Add a ProfileSingleIteration property and a constructor parameter to SnapshotProfilerBase.
  • Add a new attribute constructor, e.g. [DotMemoryDiagnoser(profileSingleIteration: true)].

Fixes #2628

Snapshots currently cover every operation of the actual run, which makes
them large and hard to use. Add an opt-in option (default: false) that
profiles only the extra iteration via the BeforeExtraIteration and
AfterExtraIteration signals.

Fixes dotnet#2628
@reabr

reabr commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@timcassell

Copy link
Copy Markdown
Collaborator

@reabr It looks like the bot did not detect your agreement. Try posting a new comment without a leading space.

@timcassell timcassell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @reabr

@timcassell
timcassell merged commit 0970e24 into dotnet:master Nov 15, 2026
20 of 21 checks passed
@timcassell timcassell added this to the v0.16.0 milestone Nov 15, 2026
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.

Behaviour of the dotMemory (and dotTrace) diagnosers

2 participants