I've been banging my head against a wall with a hard to trace bug for a while. Would you maybe have some good insight on what I'm doing wrong?
Me and my co-workers have ported a game from XNA to MonoGame for the Windows Phone 8 but we run into problems when resuming the app too many times in a row. The resume is quite slow and then after about 4 to 6 times the app crashes.
Sometimes it seems like it might be running out of memory but then more often the stack trace points to a SharpDXException with a message "The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action."
Our XNA version for the Windows Phone 7 resumes and runs without problems.
This might be related to an earlier bug we had. Some of our spritesheets disappeard when the app resumed so I tried adding a function that reloads them on resume. But with ContentManager they should only get reloaded when they've been unloaded, right? Or would that cause unnecessary memory buildup?
Have you ever ran into the same problem and would you have any idea of how to work around this? I would love to get this sorted since this is a must fix thing for us. I like my job, I want to keep it
Thank you in advance!
EDIT: This seems to be a memory management issue in my code. If you have any tips about memory management with MonoGame I'd be happy to hear them! Thanks!