microsoft / microsoft/perfview
System.NullReferenceException while taking heap snapshot
Open
@brianrob is already working on this.
Since Mar 20, 2026.
- Dominant language
- C#
- Stars
- 4.7k
- Forks
- 775
- Avg merge
- 5d 11h
- Merged PRs (30d)
- 9
Description
Version: P2.0.42 (64 bit)
Max Dump K objects: 250
Freeze: No
Save ETL: No
Tail of log:
1070.1s: Dumped 114,354,847 objects, max_dump_limit 134,217,716 Dumper heap Size 7,384MB
HeapDump Error: System.NullReferenceException: Object reference not set to an instance of an object.
at System.Collections.Generic.SegmentedList`1.Add(T item)
at Graphs.Node.WriteCompressedInt(SegmentedMemoryStreamWriter writer, Int32 value)
at Graphs.Graph.SetNodeTypeAndSize(NodeIndex nodeIndex, NodeTypeIndex typeIndex, Int32 sizeInBytes)
at Graphs.Graph.SetNode(NodeIndex nodeIndex, NodeTypeIndex typeIndex, Int32 sizeInBytes, GrowableArray`1 children)
at GCHeapDumper.DumpAllSegments()
at GCHeapDumper.DumpDotNetHeapDataWorker(ClrHeap heap, ICorDebugProcess& debugProcess, Boolean isDump, Double retryScale)
at GCHeapDumper.DumpDotNetHeapData(ClrHeap heap, ICorDebugProcess& debugProcess, Boolean isDump)
at GCHeapDumper.TryGetDotNetDump(Int32 processID)
at GCHeapDumper.CaptureLiveHeapDump(Int32 processID)
at GCHeapDumper.DumpLiveHeap(Int32 processID)
at Program.MainWorker(String[] args)
Completed: Dumping GC Heap to c:\temp\20190613.gcDump (Elapsed Time: 1071.709 sec)
Error: HeapDump failed with exit code 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.