0

I've got a background agent that, from what I see in my logs, doesn't complete its execution because it's blocked on an async Task.

Of course, to understand why it's blocked, I need to debug it using Visual Studio.

The problem is that, if I use the debugger, I get the famous OutOfMemoryException, even if MSDN states that you don't get the exception while debugging.

So the question is: how can I debug this BG Agent without running into the OutOfMemoryException?

Because I do some complex stuff in it, and logging each line of my code would be a long process.

StepTNT
  • 3,867
  • 7
  • 41
  • 82
  • can you post some code? the background agent has some memory limitations (15 - 25 depending o windows phone version) – Igor Kulman Jan 03 '14 at 22:03
  • Actually I don't know what code to post because the question is not really related to the project itself but it's a bit more wide. What I mean is that I need a way to debug the project in a situation in which the debugger's memory overhead causes the exception. As a side note, I know that a Background Agent is limited to 11MB and this is a hard limit, the other ones are for the Audio Agents. – StepTNT Jan 03 '14 at 22:09
  • If you're getting the OutOfMemoryException during debugging, you'll probably eventually get it later on when you release the app. Why not remove the memory complex stuff to be able to debug the async part? – Igor Ralic Jan 03 '14 at 23:31
  • Let's say that I can't my code for now, I just need to debug it as it is – StepTNT Jan 04 '14 at 08:36
  • I tried on my real device 2GB ram and there're 31MB allowed for background context. Hope you can debug your code that way... – Khoi Jun 27 '14 at 14:40

0 Answers0