SoundEffect loaded via ContentManager causing memory leak after resume

Simple code, only load several sfxs by “Content.Load()” and then suspend/resume. You can see that memory grows after every resume and leads into out of memory error. I also tried Song and Texture2D but those looks OK with memory.

That’s odd. I’m also experiencing errors with SoundEffects, but my problem occurs when exiting the game instead. Is there a known bug with loading SoundEffects in MonoGame?

My game is wp8 and latest nuget monogame/sharpdx. First I though I have some bug in my implementation of libgdx (as game is port from libgdx to monogame), but I end up with ultra simple example, new empty monogame project, where I just load about 30 SoundEffects via ContentManager and nothing more there. Then after suspend/resume, memory increases by several mb and again and again … Sound effects are waves converted to xnb format. Strange is that no one noticed this leak yet, but it’s very simple to reproduce. On other hand I have no other problem with SoundEffects than this, application exits normally just via Game.exit();

I have fixed this and wait for approval by the moderators. The more people who test this with full games and report back with results the better.

Especially for soundEffects I mention that we can bypass reloading altogether since they don’t need to reload. I didn’t push that in the commit because is somewhat naive, a more generic solution would be to check against a list of loaders.

Thanks! I’ll test it for sure because my (already published) game leaking right now (doesn’t survive more than 20 resumes with free memory). I’m not very experienced with wp and monogame, but I was also surprised because I though there is no need to reload of sfxs at all.