MemoryManager MemoryManager MemoryManager MemoryManager Class

Provides access to information on an app's memory usage.

Syntax

Declaration

public static class MemoryManagerpublic static class MemoryManagerPublic Static Class MemoryManager

Properties summary

Gets the app's current memory usage.

Gets the app's memory usage level.

Gets the app's memory usage limit.

Methods summary

Gets an AppMemoryReport for the app, which provides information about its memory usage.

Gets a ProcessMemoryReport for a process, which provides information about its memory usage.

Tries to set a specific memory cap for the current app or task. In cases where memory caps are shared between foreground and background components, any difference between the default cap and the new request will be assigned to the other component.

Events summary

Raised when the app's memory consumption has decreased to a lower value in the AppMemoryUsageLevel enumeration.

Raised when the app's memory consumption has increased to a higher value in the AppMemoryUsageLevel enumeration.

Raised just before the limit of how much total memory the app can use is changed.

Properties

  • AppMemoryUsage
    AppMemoryUsage
    AppMemoryUsage
    AppMemoryUsage

    Gets the app's current memory usage.

    public static ulong AppMemoryUsage { get; }public static ulong AppMemoryUsage { get; }Public Static ReadOnly Property AppMemoryUsage As ulong

    Property Value

    • ulong
      ulong
      ulong
      ulong

      The app's current memory usage.

  • AppMemoryUsageLevel
    AppMemoryUsageLevel
    AppMemoryUsageLevel
    AppMemoryUsageLevel

    Gets the app's memory usage level.

    public static AppMemoryUsageLevel AppMemoryUsageLevel { get; }public static AppMemoryUsageLevel AppMemoryUsageLevel { get; }Public Static ReadOnly Property AppMemoryUsageLevel As AppMemoryUsageLevel

    Property Value

  • AppMemoryUsageLimit
    AppMemoryUsageLimit
    AppMemoryUsageLimit
    AppMemoryUsageLimit

    Gets the app's memory usage limit.

    public static ulong AppMemoryUsageLimit { get; }public static ulong AppMemoryUsageLimit { get; }Public Static ReadOnly Property AppMemoryUsageLimit As ulong

    Property Value

    • ulong
      ulong
      ulong
      ulong

      The app's memory usage limit.

Methods

  • GetAppMemoryReport()
    GetAppMemoryReport()
    GetAppMemoryReport()
    GetAppMemoryReport()

    Gets an AppMemoryReport for the app, which provides information about its memory usage.

    public static AppMemoryReport GetAppMemoryReport()public static AppMemoryReport GetAppMemoryReport()Public Static Function GetAppMemoryReport() As AppMemoryReport

    Returns

  • GetProcessMemoryReport()
    GetProcessMemoryReport()
    GetProcessMemoryReport()
    GetProcessMemoryReport()

    Gets a ProcessMemoryReport for a process, which provides information about its memory usage.

    public static ProcessMemoryReport GetProcessMemoryReport()public static ProcessMemoryReport GetProcessMemoryReport()Public Static Function GetProcessMemoryReport() As ProcessMemoryReport

    Returns

  • TrySetAppMemoryUsageLimit(System.UInt64)
    TrySetAppMemoryUsageLimit(System.UInt64)
    TrySetAppMemoryUsageLimit(System.UInt64)
    TrySetAppMemoryUsageLimit(System.UInt64)

    Tries to set a specific memory cap for the current app or task. In cases where memory caps are shared between foreground and background components, any difference between the default cap and the new request will be assigned to the other component.

    public static bool TrySetAppMemoryUsageLimit(System.UInt64)public static bool TrySetAppMemoryUsageLimit(System.UInt64)Public Static Function TrySetAppMemoryUsageLimit(System.UInt64) As bool

    Parameters

    • value
      System.UInt64
      System.UInt64
      System.UInt64
      System.UInt64

      The new memory limit to set.

    Returns

    • bool
      bool
      bool
      bool

      True if the operation succeeded; otherwise, false.

Events

  • AppMemoryUsageDecreased
    AppMemoryUsageDecreased
    AppMemoryUsageDecreased
    AppMemoryUsageDecreased

    Raised when the app's memory consumption has decreased to a lower value in the AppMemoryUsageLevel enumeration.

    public static event EventHandler AppMemoryUsageDecreasedpublic static event EventHandler AppMemoryUsageDecreasedPublic Static Event AppMemoryUsageDecreased
  • AppMemoryUsageIncreased
    AppMemoryUsageIncreased
    AppMemoryUsageIncreased
    AppMemoryUsageIncreased

    Raised when the app's memory consumption has increased to a higher value in the AppMemoryUsageLevel enumeration.

    public static event EventHandler AppMemoryUsageIncreasedpublic static event EventHandler AppMemoryUsageIncreasedPublic Static Event AppMemoryUsageIncreased
  • AppMemoryUsageLimitChanging
    AppMemoryUsageLimitChanging
    AppMemoryUsageLimitChanging
    AppMemoryUsageLimitChanging

    Raised just before the limit of how much total memory the app can use is changed.

    public static event EventHandler AppMemoryUsageLimitChangingpublic static event EventHandler AppMemoryUsageLimitChangingPublic Static Event AppMemoryUsageLimitChanging

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.System.dll