Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (5 posts)

OutOfMemory Exception when trying to load in music files.

Last post 7/11/2017 3:04 AM by Jim Perry. 4 replies.
  • 6/29/2017 11:08 PM

    OutOfMemory Exception when trying to load in music files.

    So I released my game, SuperCluster: Void on Steam a few months ago and one of the players is getting an error. I'll post the error below. It seems to be a outofmemory exception whenever he's trying to load in the music files. There are a lot of music files in the game but no one else has had this problem and his specs are more than enough to run the game. Here's the error:



    Here's the place where the error is occurring:


    He's already tried uninstalling/reinstalling the game and the XNA 4.0 Redist.

    Any help on this would be appreciated!



  • 7/1/2017 9:40 PM In reply to

    Re: OutOfMemory Exception when trying to load in music files.

    Just out of curiosity, why are you doing Par.Par.Par?
  • 7/5/2017 3:00 AM In reply to

    Re: OutOfMemory Exception when trying to load in music files.

    It's getting access to .Content which is only available in the game class for some reason so it's using a reference to it's parent to access it.
  • 7/7/2017 6:33 PM In reply to

    Re: OutOfMemory Exception when trying to load in music files.

    Hi Logan

    If these are all music, you probably only need to load the one you are going to play.
    If the songs are big, then loading lots that are not used is wasteful.
    Developer machines tend to have loads of ram, and so you might never notice this out of memory issue.

    The only sounds that must be loaded are those that could be fired during gameplay.

    1) The Music that is about to play
    2) The SFX files

    You can the have a loader that leaves the SFX alone and just deals with changing the music
    Stop old music
    Load new music
    Play new music


    This way you are only loading one song (and keeping your sfx loaded)

    EJS
  • 7/11/2017 3:04 AM In reply to

    Re: OutOfMemory Exception when trying to load in music files.

    Logan McClure:
    It's getting access to .Content which is only available in the game class for some reason so it's using a reference to it's parent to access it.

    You're not just using a reference to the parent, you've got a reference to the parent of the parent of the parent. That's a pretty bad code design. You could always use a static instance of the ContentManager or even the Game class if you need more than the ContentManager.

Page 1 of 1 (5 posts) Previous Discussion Next Discussion