I’m trying to load data in XNA, however, whenever I use the ContentManager it throws an out of memory exception. This occurs when I load my first resource. It’s a 32×32 pixel image.
I’m using:
contentManager = (Application.Current as App).Content;
contentManager.Load<Texture2D>("Head");
I’ve been using this for ages and have no clue why it won’t work now. Does anyone have any suggestions to get me past this?
I’ve experienced this one time, it would occur consistently after coming back from a phone task (in my case it was the IAP interface).
I worked around it by delaying the content load. My assumption was that the IAP task itself was using a lot of memory and I needed to give some time for those resources to free up before trying to allocate any more resources.
You could try adding a delay before doing the content loading (not sure when you are doing it, it should be fine if you are doing it in a place like Game.Initialize though).