Skip to content

[release/10.0] Enable using CLRDATA_ENUM_MEM_HEAP2 through environment variable#125518

Draft
hoyosjs wants to merge 1 commit intodotnet:release/10.0from
hoyosjs:juhoyosa/use-heap2-10
Draft

[release/10.0] Enable using CLRDATA_ENUM_MEM_HEAP2 through environment variable#125518
hoyosjs wants to merge 1 commit intodotnet:release/10.0from
hoyosjs:juhoyosa/use-heap2-10

Conversation

@hoyosjs
Copy link
Member

@hoyosjs hoyosjs commented Mar 13, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 13, 2026 13:06
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a runtime configuration switch to enable a faster heap-dump memory enumeration mode (promoting CLRDATA_ENUM_MEM_HEAP to CLRDATA_ENUM_MEM_HEAP2) based on a target-process setting, enabling faster dump generation without requiring the dump producer to pass the newer flag.

Changes:

  • Introduces a new global (g_EnableFastHeapDumps) and exposes it via DAC globals.
  • Adds a new external config value EnableFastHeapDumps and initializes the global during EE startup.
  • Updates DAC heap-dump enumeration to auto-promote to CLRDATA_ENUM_MEM_HEAP2 when the setting is enabled.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/coreclr/vm/vars.hpp Declares g_EnableFastHeapDumps as a new runtime global.
src/coreclr/vm/vars.cpp Defines and initializes g_EnableFastHeapDumps.
src/coreclr/vm/ceemain.cpp Initializes g_EnableFastHeapDumps from CLRConfig during startup.
src/coreclr/inc/dacvars.h Adds g_EnableFastHeapDumps to the DAC globals table.
src/coreclr/inc/clrconfigvalues.h Adds EXTERNAL_EnableFastHeapDumps config knob.
src/coreclr/debug/daccess/enummem.cpp Promotes heap dump enumeration to HEAP2 when enabled in the target.

You can also share your feedback on Copilot code review. Take the survey.

#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
RETAIL_CONFIG_DWORD_INFO(INTERNAL_MiniMdBufferCapacity, W("MiniMdBufferCapacity"), 64 * 1024, "The max size of the buffer to store mini metadata information for triage- and mini-dumps.")
#endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableFastHeapDumps, W("EnableFastHeapDumps"), 0, "If non-zero, uses CLRDATA_ENUM_MEM_HEAP2 for heap dumps which enumerates loader heap pages in bulk instead of walking individual runtime data structures.")
// faster and produces equivalent dump content since all runtime
// data structures reside in loader heaps.
flags = CLRDATA_ENUM_MEM_HEAP2;
DacLogMessage("EnumMemoryRegions(CLRDATA_ENUM_MEM_HEAP promoted to HEAP2 via DOTNET_EnableFastHeapDumps)\n");
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.

2 participants