MemoryManager
MemoryManager
MemoryManager
MemoryManager
Class
Definition
Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Prerelease APIs are identified by a Prerelease label.
[Contains prerelease APIs.]
Provides access to information on an app's memory usage.
public : static class MemoryManagerpublic static class MemoryManagerPublic Static Class MemoryManager// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
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// You can use this property in JavaScript.
- 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// You can use this property in JavaScript.
The app's memory usage level.
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// You can use this property in JavaScript.
- Value
- ulong ulong ulong ulong
The app's memory usage limit.
ExpectedAppMemoryUsageLimit ExpectedAppMemoryUsageLimit ExpectedAppMemoryUsageLimit ExpectedAppMemoryUsageLimit
Prerelease. Gets the amount of memory that your app may expect to have available.
public : static ulong ExpectedAppMemoryUsageLimit { get; }public static ulong ExpectedAppMemoryUsageLimit { get; }Public Static ReadOnly Property ExpectedAppMemoryUsageLimit As ulong// You can use this property in JavaScript.
- Value
- ulong ulong ulong ulong
The expected memory cap in bytes.
| Device family |
Windows 10 Insider Preview (introduced v10.0.16257.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v5)
|
Remarks
When an app launches on Xbox, it is initially given a small app memory usage limit that may grow as the system frees memory. This property returns the expected upper limit that your app will be able to use.
When an app launches on a non-Xbox system, the memory usage limit the app gets at launch remains the same and this property will return the same value as Windows.System.MemoryManager.AppMemoryUsageLimit.
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// You can use this method in JavaScript.
Information about the process' memory usage.
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// You can use this method in JavaScript.
Information about the process' memory usage.
TrySetAppMemoryUsageLimit(UInt64) TrySetAppMemoryUsageLimit(UInt64) TrySetAppMemoryUsageLimit(UInt64) TrySetAppMemoryUsageLimit(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 PlatForm::Boolean TrySetAppMemoryUsageLimit(unsigned __int64 value)public static bool TrySetAppMemoryUsageLimit(UInt64 value)Public Static Function TrySetAppMemoryUsageLimit(value As UInt64) As bool// You can use this method in JavaScript.
- value
- unsigned __int64 UInt64 UInt64 UInt64
The new memory limit to set.
True if the operation succeeded; otherwise, false.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
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 AppMemoryUsageDecreased<object>public static event EventHandler AppMemoryUsageDecreased<object>Public Static Event AppMemoryUsageDecreased<object>// You can use this event in JavaScript.
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 AppMemoryUsageIncreased<object>public static event EventHandler AppMemoryUsageIncreased<object>Public Static Event AppMemoryUsageIncreased<object>// You can use this event in JavaScript.
AppMemoryUsageLimitChanging AppMemoryUsageLimitChanging AppMemoryUsageLimitChanging AppMemoryUsageLimitChanging
Raised just before the limit of how much total memory the app can use is changed.
public : static event EventHandler AppMemoryUsageLimitChanging<AppMemoryUsageLimitChangingEventArgs>public static event EventHandler AppMemoryUsageLimitChanging<AppMemoryUsageLimitChangingEventArgs>Public Static Event AppMemoryUsageLimitChanging<AppMemoryUsageLimitChangingEventArgs>// You can use this event in JavaScript.