microsoft / microsoft/perfview

System.NullReferenceException while taking heap snapshot

Open
#951 3 comments 2 reactions 2 assignees View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.