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

I am working on a planned background agent for Mango (7.1)

I managed to reduce memory usage from 10.5 MB to 6.5 MB using manual tracing methods based on DeviceStatus.ApplicationPeakMemoryUsage , as well as some reasonable guesses about what needs to be optimized.

However, now I need to drop below 6 MB - and the final 0.5 MB will be elusive.

I managed to run Windows Phone Performance Analysis in the main application, but it seems that I cannot find a way to make it work against the agent.

Are there any tools and / or methods that will help me in developing what fills the memory of my agent? Ideally, I would like to explore the entire memory space, including code and data, and ideally it should work against the release build.

+4
source share
3 answers

As already mentioned, the debugger will add a little memory overhead. So the best way I found:

+5
source

Remember that when starting the background agent in debug mode, this adds about 2 MB to the agent’s memory area, so you can be fine.

Perhaps you can still use ApplicationPeakMemoryUsage and write the memory data to a file in isolated storage when you run the application directly, and not in Visual Studio.

HTH - Rupert.

+1
source

You may find the following blog post, which you may have already seen, but it describes both adding debugging memory and some tips for reducing memory.

http://www.pitorque.de/MisterGoodcat/post/Windows-Phone-Background-Agents-Pitfalls-(2-of-n).aspx

0
source

Source: https://habr.com/ru/post/1414112/


All Articles