alitaleg
alitaleg

Reputation: 175

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?

Upvotes: 0

Views: 577

Answers (1)

Anz
Anz

Reputation: 594

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.

Upvotes: 2

Related Questions