URGENT + FMOD Current Memory Problem

Hey guys,

1- I have a question concerning FMOD memory. Main menu FMOD current memory states 3 MB because of main menu music after that when you play game memory risen 21 mb. Everything is ok but when I go back to main menu memory is not clear, it’s hold 21. After that if you play again game it will rise 40 mb and again not clear when you go back to the main menu. How can I clear memory when not event plays.
2- I have two event what are play same time in the game. I want to play only one. How can I do that?

Are you able to share any logs you may have? Preferably showing any errors/logs before the first occurrence of the issue.

Hi, I’m having the same issue, and in addition to this, once I go in game again all the sounds stop and it start to crash Unity, I already updated FMOD to the 2.01.09 but still does it, I don’t always have errors logs, but I had some:
[FMOD] assert : assertion: ‘count() == 0’ failed
[FMOD] assert : assertion: ‘isEmpty()’ failed
and also some of this:
[FMOD] EventDescription::createInstance(2104736, 3551396) returned ERR_MEMORY for STUDIO_EVENTDESCRIPTION (0x201DA0).

Can you try changing the FMOD logging to level Log and share the entire output log when it crashes again, from either Unity - Manual: Log Files or the crash logs.

I know this is an older thread, but I just found this when I was looking for a solution because I hade the same error mesages.

The root cause for my issue was that I in a few cases I did the following (dummy code, not actual syntax):

// Check if I have already started my desired sound - this is within a Unity Update()
if (instance.playbackstate is not PLAYING, STARTING or SUSTAINING)
{
// Create a new instance and store it in a global variable, without immediately
// releasing it, because i might need to be able to stop/modify it
my_instance = create_and_play_a_new_instance();
}

I had this piece of code on all my enemy types. Now the events that are handled like this all have a maximum number of instances, so as soon as that maximum number was reached, the following happened:

  • My code plays the event instance
  • FMOD Studio stops it again, because it is stolen by a more important instance
  • My code sees that the event instance is not playing and therefore starts playing a (new!) instance
  • FMOD Studio stops it again, because …

This lead to a viscious circle, creating over 37k event instances. At that stage the game threw the errors mentioned above, and grinded to a halt.

I now check instance.IsValid() instead to see if I already started to play an event instance (whether FMOD stops the event because it’s being stolen is none of my concern).
I also made sure that everything that runs for more than a second or two, has its stealing behaviour set to Virtualize.

Now I can do what I want to my game, and not even reach 200 instances, and stealing works perfectly.

1 Like