dotMemory 2024.1 Help

Heap Fragmentation

Use the Heap Fragmentation diagram to evaluate the fragmentation of the managed heap segments:

  • Generation 1 and 2 heap segments.

  • Large object heap (LOH) – a separate heap for large objects (85,000 bytes and larger). LOH fragmentation can be a serious issue (see .NET Memory Management Concepts).

  • Pinned object heap – a separate heap for objects that are prohibited from moving within the heap. You can open pinned objects as a separate object set.

  • Frozen object heap (FOH) – a separate heap for immutable objects.

Clicking the diagram header will open the Group by Generations view for all objects in the snapshot.

Heap fragmentation
  1. Heap segment name.

  2. Number of heaps within a segment.

    Each bar on the diagram represents a certain heap.

  3. Total heap segment size defined by GC.

    The length of bars on the diagram corresponds to the total size of certain heaps within a segment. Note that the total size may be slightly larger than the sum of pinned, unpinned, and free: The total size also includes memory blocks used for alignment, padding, and other specific purposes.

  4. Total size of pinned objects.

    Pinned objects are prohibited from moving within the heap. Typically, such objects are used by some unmanaged code or may be a result of using the fixed statement.

  5. Total size of all objects (excluding pinned objects) allocated in the heap segment.

  6. Total size of free memory in the heap segment.

Heap Fragmentation also lets you open two specific object sets:

Unreachable objects
Last modified: 10 April 2024