7
\$\begingroup\$

I am currently porting a game from WP7 using XNA to WP8.1 using MonoGame. I have been putting considerable effort into optimizing my game to be under the 185MB memory limit for low-memory phones.

I was making headway until I discovered a memory spike on startup. I continued to reduce the quality of my assets until the memory usage (while the game is running) is at about 140MB. However, on startup, the memory usage spikes to 205MB, sits there for about 10 seconds, and then drops to standard operating memory usage. It does this every time. Increasing or decreasing the asset sizes only changes how high the spike goes and the usage in general, but it does not change the 10 second delay at all.

One idea I thought about was to delay the user with a longer splash screen, giving me time to load all the assets without blowing the hatch. But this seems to me like detracting from the user experience out of convenience.

Any ideas? Has anyone else had this problem?

\$\endgroup\$
  • \$\begingroup\$ I don't think we can answer this given the provided information, aside from agreeing with your thoughts on a splash screen. On a side note, as you may already be aware, XNA is deprecated (and MonoGame is just a framework which uses XNA). \$\endgroup\$ – Evorlor Aug 21 '15 at 8:56
  • 2
    \$\begingroup\$ Perhaps I should have been more clear: I am wondering if this is normal behavior for ALL MonoGame games (something in the source code of monogame) or whether it is not (something in my code somewhere). \$\endgroup\$ – Ramsay Smith Aug 21 '15 at 14:58
  • 1
    \$\begingroup\$ Can you try and not load any sounds and see it there is a smaller spike ? Perhaps it is because of a sound conversion that is happening and then the garbage collector takes a few seconds to clear the disposed objects. \$\endgroup\$ – dimitris93 Aug 21 '15 at 16:18
  • \$\begingroup\$ @Evorlor MonoGame does not use XNA in any way beyond reimplementing it's functionality. \$\endgroup\$ – JonBee Jun 3 '16 at 15:46
1
\$\begingroup\$
  • Try to compress your assets
  • Load only the necessary things for the first scene (like Main Menu)
  • Avoid stock splash screen and write your own. So I mean, don't load anything at start-up. Then e.g make an animating splash screen. And load your assets slowly when splash screen fades out.

Hope, one of them helps

(Sorry for bad English)

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.