Reputation: 599
I am wondering if there is a way for a Universal Windows Phone app (Windows Phone 8.1 or 10) to detect if the app is using much memory and is approaching the memory limit that apps have on a Windows Phone (before it gets killed by the OS)?
Ideally the OS/platform would provide API/services for an app to register and listen to an event that is raised, telling the app that it has consumed almost all of the memory that it is allowed to have so that the app can take appropriate actions (force release some cached data) to clear up some memory and avoid being killed by the OS. But I'm not sure if such API exists on Windows Phone 8.1 or 10 for a Universal Windows App!?
Upvotes: 1
Views: 52
Reputation: 21899
The Windows.System.MemoryManager methods report on the app's memory usage and memory limit and raises events as the limit changes and as usage increases and decreases between low, medium, and high levels.
Upvotes: 2