Vixen
02b45cc4
csharp
public sealed class MemoryView

Doc 13's four memory arenas, each with its rows.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ Refreshed on a button rather than every frame, and that is not laziness. GC.GetGCMemoryInfo and a walk of the leak tracker's dictionary are both real work, and a panel that did them sixty times a second would be a memory panel that allocates. It also makes the numbers readable: a heap size that changes every frame is one nobody can compare with the one they wrote down a minute ago.

⚠ Refreshing must not collect. GC.GetTotalMemory(true) would give a tidier number by running a blocking gen-2 collection first — which changes what is being measured and stalls the editor. MemorySnapshot passes false and says so.

Fields and properties (8)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public UiElement Toolbar

    The strip along the top.

  • public Button Refresh

    What takes a fresh reading.

  • public UiElement Status

    When the reading on screen was taken.

  • public ScrollView Body

    Where the rows go.

  • public MemoryProviders Providers

    Where the arenas this assembly cannot see into come from.

  • public MemorySnapshot? Snapshot

    The reading on screen.

Methods (4)

  • public void Take()

    Takes a fresh reading and shows it.

  • public void Show(MemorySnapshot snapshot)

    Shows a reading somebody else took.

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • public static string Bytes(long bytes)

    Formats a byte count the way a person reads one.

Used by (5)

  • DiagnosticsModuleVixen.Editor.Diagnostics
  • DiagnosticsPanelTestsVixen.Editor.App.Tests
  • EditorApplicationVixen.Editor.App
  • StatisticsAndMemoryTestsVixen.Editor.Profiler.Tests
  • StatisticsViewVixen.Editor.Profiler