Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class MemorySnapshot

    A point-in-time view of memory usage across categories. Designed to be cheap to construct (small allocations only) and trivially serializable via System.Text.Json.

    Inheritance
    object
    MemorySnapshot
    Implements
    IEquatable<MemorySnapshot>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: PopcorningGuineaPig.Engine.Diagnostics
    Assembly: PopcorningGuineaPig.Engine.dll
    Syntax
    public sealed record MemorySnapshot : IEquatable<MemorySnapshot>

    Constructors

    | Edit this page View Source

    MemorySnapshot(DateTime, IReadOnlyDictionary<MemoryCategory, long>, int, int, int, long, string, IReadOnlyDictionary<string, long>?, IReadOnlyDictionary<string, AssetCounts>?)

    A point-in-time view of memory usage across categories. Designed to be cheap to construct (small allocations only) and trivially serializable via System.Text.Json.

    Declaration
    public MemorySnapshot(DateTime CapturedAtUtc, IReadOnlyDictionary<MemoryCategory, long> BytesByCategory, int Gen0Collections, int Gen1Collections, int Gen2Collections, long TotalAllocatedBytesSinceStart, string Description, IReadOnlyDictionary<string, long>? TextureBytesByScene = null, IReadOnlyDictionary<string, AssetCounts>? AssetCountsByScene = null)
    Parameters
    Type Name Description
    DateTime CapturedAtUtc

    UTC timestamp the snapshot was assembled. Sampled before the data reads so it is never later than the data it describes.

    IReadOnlyDictionary<MemoryCategory, long> BytesByCategory

    Bytes attributed to each MemoryCategory. Every enum value is present; absent values would be a bug.

    int Gen0Collections

    Number of Gen0 garbage collections since process start (GC.CollectionCount(0)).

    int Gen1Collections

    Number of Gen1 garbage collections since process start.

    int Gen2Collections

    Number of Gen2 garbage collections since process start.

    long TotalAllocatedBytesSinceStart

    Cumulative allocations since process start (GC.GetTotalAllocatedBytes(precise: false)).

    string Description

    Free-form label for the snapshot (e.g., scenario name or user-supplied tag).

    IReadOnlyDictionary<string, long> TextureBytesByScene

    Texture bytes grouped by scene tag (Story 12.3 Task 1). Empty-string key holds untagged assets. May be empty when no scene-aware capture is available.

    IReadOnlyDictionary<string, AssetCounts> AssetCountsByScene

    Asset counts grouped by scene tag (Story 12.3 Task 1). Empty-string key holds untagged assets.

    Properties

    | Edit this page View Source

    AssetCountsByScene

    Asset counts grouped by scene tag (Story 12.3 Task 1). Empty-string key holds untagged assets.

    Declaration
    public IReadOnlyDictionary<string, AssetCounts>? AssetCountsByScene { get; init; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, AssetCounts>
    | Edit this page View Source

    BytesByCategory

    Bytes attributed to each MemoryCategory. Every enum value is present; absent values would be a bug.

    Declaration
    public IReadOnlyDictionary<MemoryCategory, long> BytesByCategory { get; init; }
    Property Value
    Type Description
    IReadOnlyDictionary<MemoryCategory, long>
    | Edit this page View Source

    CapturedAtUtc

    UTC timestamp the snapshot was assembled. Sampled before the data reads so it is never later than the data it describes.

    Declaration
    public DateTime CapturedAtUtc { get; init; }
    Property Value
    Type Description
    DateTime
    | Edit this page View Source

    Description

    Free-form label for the snapshot (e.g., scenario name or user-supplied tag).

    Declaration
    public string Description { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Gen0Collections

    Number of Gen0 garbage collections since process start (GC.CollectionCount(0)).

    Declaration
    public int Gen0Collections { get; init; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Gen1Collections

    Number of Gen1 garbage collections since process start.

    Declaration
    public int Gen1Collections { get; init; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Gen2Collections

    Number of Gen2 garbage collections since process start.

    Declaration
    public int Gen2Collections { get; init; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    JsonOptions

    The canonical JsonSerializerOptions to use when reading or writing MemorySnapshot JSON. Pins the on-disk format so future framework-default changes (e.g. a globally-registered JsonStringEnumConverter elsewhere) cannot silently shift the enum-keyed dictionary representation.

    Declaration
    public static JsonSerializerOptions JsonOptions { get; }
    Property Value
    Type Description
    JsonSerializerOptions
    | Edit this page View Source

    TextureBytesByScene

    Texture bytes grouped by scene tag (Story 12.3 Task 1). Empty-string key holds untagged assets. May be empty when no scene-aware capture is available.

    Declaration
    public IReadOnlyDictionary<string, long>? TextureBytesByScene { get; init; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, long>
    | Edit this page View Source

    TotalAllocatedBytesSinceStart

    Cumulative allocations since process start (GC.GetTotalAllocatedBytes(precise: false)).

    Declaration
    public long TotalAllocatedBytesSinceStart { get; init; }
    Property Value
    Type Description
    long

    Implements

    IEquatable<T>
    • Edit this page
    • View Source
    In this article
    Back to top © 2024 Popcorning Guinea Pig Game Engine. A custom C# game engine for indie developers.