Skip to content

HeapDump fails with lots of objects #2401

Description

@riezebosch
*****  Attempting a .NET Heap Dump.
Enumerating over 1 detected runtimes...
Created SymbolReader with SymbolPath 
Symbol Path Updated to ;SRV*https://msdl.microsoft.com/download/symbols
Symbol Path update forces clearing Pdb lookup cache
Creating Runtime access object for runtime 4.8.9195.0.
Enumerating over 1 detected runtimes...
DumpDotNetHeapData: Heap Size 2 MB
Dumping GC heap, This process is a 64 bit process on a 64 bit OS
  0.2s: Starting heap dump 3/30/2026 11:00:51 AM
  0.3s: Size of heap = 434.312 GB
In a 64 bit process.  Increasing the max node count to 134.2 Meg
Implicitly limit the number of nodes to 134.2 Meg to avoid arrays that are too large
Estimated number of objects = -1,803,803,449
HeapDump Error (-2146233086): System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: capacity
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2..ctor(Int32 capacity, IEqualityComparer`1 comparer)
   at Graphs.MemoryGraph..ctor(Int32 expectedSize, Boolean isVeryLargeGraph)
   at GCHeapDumper.DumpDotNetHeapDataWorker(DataTarget dataTarget, ClrRuntime[] runtimes, Double retryScale)
   at GCHeapDumper.DumpDotNetHeapData(DataTarget dataTarget, ClrRuntime[] runtimes)
   at GCHeapDumper.TryGetDotNetDump(Int32 processID, Int32& pointerSize, String[]& configDirectories)
   at GCHeapDumper.CaptureLiveHeapDump(Int32 processID)
   at GCHeapDumper.DumpLiveHeap(Int32 processID)
   at Program.MainWorker(String[] args)

0.3s: Size of heap = 434.312 GB
Estimated number of objects = -1,803,803,449

smells like integer overflow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions