简体   繁体   中英

Windows Phone Background Agent Memory Limit

I have a Windows Phone background agent that I am debugging using the Emulator 720P which is supposed to have 1GB of Memory.

According to this article, the agent on such a device can use up to 20MB of memory.

http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202942%28v=vs.105%29.aspx

However, when I debug through the agent using

Microsoft.Phone.Info.DeviceStatus.ApplicationMemoryUsageLimit / 1024;

I get 11MB returned.

I also tried an actual phone that has more than 1GB of RAm and still get the same result.

Am I doing something wrong here?

11 MB is the correct limit. You misread the part where the documentation mentions about audio agents.

Periodic agents and resource-intensive agents can use no more than 20 MB of memory at any time on devices with 1 GB of memory or more. On lower-memory devices, the limit is 11 MB. Audio agents have the memory caps described below. If a Scheduled Task exceeds these memory caps, it is terminated immediately.

The RAM that you have on your device does not really matter. This is a soft limit put on by the OS to limit resource usage. By my experience this memory limit is enough to generate tiles and checking location etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM