4

I am making a WP8 image processing app in c#, and am having some memory issues.

If I navigate away from the app, and navigate back a bunch of times, I run out of memory (eg. Home -> back -> home -> back...).

I was wondering how to debug this issue? I am trying to clean up memory as much as I can (using Dispose/setting things to null), but it isn't working.

How would I debug it? Is there a way to find out how the memory is being used by what?

Toadums
  • 2,772
  • 8
  • 44
  • 67

2 Answers2

3

Check the answer from this question:

Windows Phone Memory Profilers

The Windows Phone SDK comes with a profiler for both memory consumption, and other things, that's available in Visual Studio after installation of the SDK.

Or, here's a direct link to the MSDN article:

http://msdn.microsoft.com/en-us/library/hh202934%28v=vs.92%29.aspx

UPDATE:

It looks like that question was targeted for WP7, so it may or may not be applicable. However, I found an article which applies to both WP8 and WP7:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202934(v=vs.105).aspx

Community
  • 1
  • 1
lhan
  • 4,585
  • 11
  • 60
  • 105
1

lhan16's answer is spot on.

What you'll need to do is use Memory Profiling and periodically check which the memory Heap to see what's allocated when it shouldn't be. That'll at least help you narrow down who might be the culprit for your memory leak. I wrote an article that included a trivial example ofstoring too many Byte[] and how to find those using the Memory Profiling tools @ http://www.developer.nokia.com/Community/Wiki/Techniques_for_memory_analysis_of_Windows_Phone_apps#Profiling

JustinAngel
  • 16,082
  • 3
  • 44
  • 73