Detect Approaching App Mem Limit on Windows Phone - memory-management

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!?

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.

Related

Is it possible to getting total/available memory on Windows Phone?

How to getting total/available memory on Windows Phone? The total/available memory what I mean is for the whole device, not only for my application itself, can I get them?
You can get the device's total memory (potentially useful for detecting low memory devices) by using the DeviceExtendedProperties class on 7.0 or the DeviceStatus class on 7.1.
You can also access the amount of memory your app is currently using and the most it has used, but there is no way to find the available memory for the device.
Your application can only access the memory of its isolated storage and cannot interrupt with other applications. This is a constraint but have to cope with it.

Windows Phone App Memory Consumption

I am developing app for Windows Phone. My application is a little game for children which is based on silverlight animation. In app I can navigate to 1 to 3 pages and when the whole game logic completed It again goes to the start screen at the end of game and you can start again. When I complete 3 or four rounds, I saw that my application is consuming more than 80 MB (or more) of Phone RAM. Is there any chances of app rejection from Windows Phone app store if it is consuming such amount of memory???
For Low memory devices, the maximum memory limit for a Silverlight app is 90MB for WP7 and 150MB for WP8.
So, your app may run into performance issues as the no of rounds progresses.
I think you are aware of the Performance analysis tests in Visual Studio, if not check this : Techniques for memory analysis of Windows Phone apps
And you can follow the suggestions mentioned here : App performance considerations for Windows Phone

Windows Phone Background Transfer Policies Transfer Limits

On Background file transfers for Windows Phone it says:
Limits
Maximum outstanding requests in the queue per application (this
includes active and pending requests): 25
But it seems that the Limit is 5. (According to my debugs and heaps of googling)
Is this OS version difference between 7.1 and 8.0?
If different versions have different limits is there away to get that maximum limit without hardcoding it?
you can read it here
Background file transfers for Windows Phone

Increase memory limit for background application

Windows Phone 7 gives you 6 MB of memory for a background application. How can I increase this limit?
I'm using WP 7.1.1 with the latest updates.
Windows Phone has very strict rules about background agents. So, going past this limitation is not possible, unless you modify the registry after an interop-unlock.

What is the appropriate number of memory usage for Windows Phone app

as my title.
I heard that my friend's app was failed to publish to marketplace. Because it consumes more than 90MB phone memory.
I'm developing an application and it uses about 30-60 MB (according to memory counter display from this link.)
Firstly I thought it was too much for a mobile app. I put all my data entries into memory in order to do search, instead of querying them from SQLite which is too slow for me.
So what do you think about the appropriate number of the phone memory for a regular mobile application.
Well, Microsoft Certification Requirements document says that:
An application must not exceed 90 MB of RAM usage, except on devices that have more than 256 MB of memory.
If you break this rule, your application won't pass Microsoft certification process.

Resources