Search code examples
windows-phone-7windows-phone-7.1background-agents

How can I profile the memory usage in a wp7.1 background agent?


I'm working on a scheduled background agent for Mango (7.1)

I've managed to cut my memory usage down from 10.5MB to 6.5MB using manual trace techniques based on DeviceStatus.ApplicationPeakMemoryUsage along with some intelligent guesswork about what to optimise.

However, now I need to get down to below 6MB - and the final 0.5MB is proving elusive.

I've managed to run the "Windows Phone Performance Analysis" tool on the main app, but can't seem to find a way to get it to run against the agent.

Are there any tools and/or techniques available to assist me in working out what is filling up my agent's memory? Ideally I'd like a way to investigate the entire memory space - including both code and data, and ideally it should work against a release build.


Solution

  • As has already been said, the debugger will add a non-negligible memory overhead. So the best way I found is: