# Instances accumulate

**URL:** <https://qa.fmod.com/t/instances-accumulate/14792>\
**Category:** Unity\
**Created:** [June 19, 2019, 1:01am UTC](https://qa.fmod.com/t/instances-accumulate/14792 "2019-06-19T01:01:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirevanac](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/sirevanac/32/480_2.png) [@Sirevanac](https://qa.fmod.com/u/Sirevanac)\
**Post date:** [June 19, 2019, 1:01am UTC](https://qa.fmod.com/t/instances-accumulate/14792/1 "2019-06-19T01:01:11Z")

</div>

Hello! For some reason, within the first minutes of play, the sound instances in the game start to accumulate and stop making sound (although the instance is created and it stays in time, like it started and paused instantly). Then, at some point, all the instances are executed at the same time. Attaching image to see how everything’s going smoothly, then it starts going bonkers.

The CPU event peaks are not from any particular event, although it might be the events accumulating.

I’ve just updated from 1.10.03 to 1.10.13 but it didn’t change the problem.

Does anybody know why this happen? It’s driving me crazy ☹

![Capture](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/3c84ab6a4adda88ff09412348d0856bea8154d3e.png)

---

<div class="post-metadata">

**Author:** ![dtbs](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@dtbs](https://qa.fmod.com/u/dtbs)\
**Post date:** [June 19, 2019, 3:42am UTC](https://qa.fmod.com/t/instances-accumulate/14792/2 "2019-06-19T03:42:24Z")

</div>

I’ve encountered this problem , maybe you need to update your Fmod Studio to at least 1.10.11

---

<div class="post-metadata">

**Author:** ![Sirevanac](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/sirevanac/32/480_2.png) [@Sirevanac](https://qa.fmod.com/u/Sirevanac)\
**Post date:** [June 19, 2019, 1:43pm UTC](https://qa.fmod.com/t/instances-accumulate/14792/3 "2019-06-19T13:43:30Z")

</div>

Oh, sorry I didn’t clarify, I’ve now edited the post. When I saw this problem I updated to 1.10.13, but no changes 😕

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [June 24, 2019, 12:23am UTC](https://qa.fmod.com/t/instances-accumulate/14792/4 "2019-06-24T00:23:51Z")

</div>

How are you playing most of your Events? Through the StudioEventEmitter or custom scripts?

If Events are accumulating then the first thing to check is that release is being called.

As @dtbs mentioned, there was previously a bug that would cause some Events not to be release properly but this bug was fixed in 1.10.11.

Are the Events actually stopping? Release will only be triggered once the Event has been stopped, either manually or naturally.

---

<div class="post-metadata">

**Author:** ![simrik1](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@simrik1](https://qa.fmod.com/u/simrik1)\
**Post date:** [June 25, 2019, 11:43am UTC](https://qa.fmod.com/t/instances-accumulate/14792/5 "2019-06-25T11:43:14Z")

</div>

Hey Sirevanac,

Have you checked the life spans of your events (can you display them in the profiler)?

best,  
Ulrich

---

<div class="post-metadata">

**Author:** ![capybara](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@capybara](https://qa.fmod.com/u/capybara)\
**Post date:** [October 10, 2019, 2:15am UTC](https://qa.fmod.com/t/instances-accumulate/14792/6 "2019-10-10T02:15:39Z")

</div>

I’m having this problem with Studio version 1.10.12. It happens in the Studio tool itself (and in game). Here’s my setup, I have two scatterers on the same track, and within each scatterer’s Playlist is a nested event (one distinct nested event for each scatterer):

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/942f99a4d92887dc949092d7a8b5fca056545c99.png)  
Here’s what one of the nested events looks like (it’s not a persistent event):  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/ed4f97997b7ff5d0c8e6dc6e5451c6a4b9c224cf.png)

In case you’re wondering, the reason I put a nested event in the scatterer is because I wanted to pitch down the sound without the spawn interval time being affected.

If I leave the Spawn Stealing value as “Oldest” for the bottom scatterer, I get an accumulation of instances. If I switch it to “None”, there’s no accumulation. However, the upper scatterer doesn’t get the accumulation with “Oldest” or “None”, so that’s rather mysterious too. Here’s what I’m seeing in Studio (note the accumulation in the bottom scatterer):

 ![FMODInstanceAccum](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/fbb20b10472c1b568d6d6abacf7d397ccb7f4f4f.gif)

Is this a bug or maybe I’m doing something wrong?

Thanks,  
Sean

---

<div class="post-metadata">

**Author:** ![capybara](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@capybara](https://qa.fmod.com/u/capybara)\
**Post date:** [October 10, 2019, 9:45pm UTC](https://qa.fmod.com/t/instances-accumulate/14792/7 "2019-10-10T21:45:38Z")

</div>

To follow up, despite it seeming like setting Stealing to “None” fixes the instance accumulation problem, this is what I’m seeing in-game with this event. The parent event is called //Fog/Move, and the Nested Event (2) inside of the above mentioned scatterer is continuously growing in terms of instances.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/18eb1f89240b5620852a03c342ad0bf56e22e01f.png)  
Maybe our code needs to be doing something with EventInstance::release() to clean up those nested events?

Thanks,  
Sean

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [October 14, 2019, 5:31am UTC](https://qa.fmod.com/t/instances-accumulate/14792/8 "2019-10-14T05:31:41Z")

</div>

You shouldn’t need to do any manual releasing for nested events. Are you able to create a small project that reproduces this issue and send it over to [support@fmod.com](mailto:support@fmod.com)? I am not able to reproduce it on our machines.

---

<div class="post-metadata">

**Author:** ![capybara](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@capybara](https://qa.fmod.com/u/capybara)\
**Post date:** [October 16, 2019, 7:29am UTC](https://qa.fmod.com/t/instances-accumulate/14792/9 "2019-10-16T07:29:48Z")

</div>

Hi Richard, I’ve sent over small project for you to check out. Sorry for the delay.

Thanks,  
Sean
