# Unity Locksup Infinitely with Domain Reload as well as ERR\_MEMORY leak issue

**URL:** <https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167>\
**Category:** Unity\
**Tags:** unity\
**Created:** [May 7, 2021, 7:59am UTC](https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167 "2021-05-07T07:59:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dairnon](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Dairnon](https://qa.fmod.com/u/Dairnon)\
**Post date:** [May 7, 2021, 7:59am UTC](https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167/1 "2021-05-07T07:59:16Z")

</div>

So I’m dealing with two issues here.

One related to the SystemNotInitializedException: [FMOD] Initialization failed : FMOD.Studio.System.create : ERR\_MEMORY : Not enough memory or resources. memory leak error.

And another dealing with Domain Reload and a Locking up.

The memory leak one is simple, I’m using FMOD with timeline, and replaying the timeline cutscene repeatedly builds up the usage of memory and eventually prevents usage of FMOD.

This only became an issue after experimenting with FMOD with timeline.  
For context my playmode settings are on, and I’m just using Reload Scene.

When I tried removing the settings or activated Domain Reload, I noticed that Unity locks up right away telling me Hold On (busy for x) Application.Reload.

This is very frustrating to deal with so late in my projects development now, and I’ve already devoted a lot of time to implimenting FMOD…

Edit\* I just discovered that if I play the timeline cutscene once with fmod players added to it and then attempt to edit and compile code, it’ll also lock on Reload Script Assemblies.

This only happens with fmod being used with timeline it seems… i never experienced any of these issues before it.

---

<div class="post-metadata">

**Author:** ![ben\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ben_fmod/32/1452_2.png) [@ben\_fmod](https://qa.fmod.com/u/ben_fmod)\
**Post date:** [May 16, 2021, 11:27pm UTC](https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167/2 "2021-05-16T23:27:39Z")

</div>

Thanks for letting us know about these issues. Unfortunately I haven’t been able to reproduce them so far. What versions of FMOD and Unity are you using? Are you able to send us a stripped-down project that demonstrates the issue?

---

<div class="post-metadata">

**Author:** ![Martin\_PixelToys](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Martin\_PixelToys](https://qa.fmod.com/u/Martin_PixelToys)\
**Post date:** [December 13, 2021, 12:05pm UTC](https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167/3 "2021-12-13T12:05:55Z")

</div>

I’ve run into a pretty similar issue (infinite Unity Domain Reload) and managed to fix it by doing this:

```auto
            FMOD.Studio.INITFLAGS studioInitFlags;
#if UNITY_EDITOR
            //FIX FOR CRASHES
            studioInitFlags = FMOD.Studio.INITFLAGS.SYNCHRONOUS_UPDATE;
#else
            //ORIGINAL LINE
            studioInitFlags = FMOD.Studio.INITFLAGS.NORMAL | FMOD.Studio.INITFLAGS.DEFERRED_CALLBACKS;
#endif

```

As for the root cause of the issue, I assume there is some thread shenanignas / issue inside FMOD which prevents me from shutting down the system correctly. That is what my callstack indicates at least  
 ![FMOD callstack](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/f/fe36662244169bced8fc3b78e7bc77d3e2ba1e00.png)

I don’t have time to debug this further, but it could also have something to do with either some Unity / Mono quirks ([link](https://forum.unity.com/threads/assembly-reload-freezing-problem.757214/#post-5055341) or with my computer setup (Unity + FMOD For Unity Plugin, but _without_ FMOD Studio installed, since I’m a programmer).

I hope that helps you debug this @ben_fmod

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [April 6, 2022, 6:46am UTC](https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167/4 "2022-04-06T06:46:20Z")

</div>

Hi Martin, apologies for the delayed response- I have reproduced the original issue and verified that your workaround prevents the infinite domain reload, though I am still getting occasional crashes.  
We are currently in the process of reworking the auditioning system which should resolve these timeline issues in an upcoming release. I have passed your suggested workaround on to the development team to help them investigate the underlying issue, thank you for the suggestion!

---

<div class="post-metadata">

**Author:** ![miha.rataj](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@miha.rataj](https://qa.fmod.com/u/miha.rataj)\
**Post date:** [June 6, 2023, 11:57am UTC](https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167/5 "2023-06-06T11:57:55Z")

</div>

> [@jeff\_fmod](#):
>
> king the auditioning system which should resolve these timeline issues in an upcoming release. I have passed your suggested workaround on to the development team to help them investigate the underlying iss

Hi! Is there any update on this topic?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [June 7, 2023, 12:16am UTC](https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167/6 "2023-06-07T00:16:06Z")

</div>

Yes, should be fixed as of 2.01.16/2.02.07.  
If you are on a later version than either of these and still running into issues, please let me know- otherwise updating to the latest version of FMOD should fix this issue.

---

<div class="post-metadata">

**Author:** ![flaxenflash](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/flaxenflash/32/6886_2.png) [@flaxenflash](https://qa.fmod.com/u/flaxenflash)\
**Post date:** [November 12, 2024, 12:34am UTC](https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167/7 "2024-11-12T00:34:34Z")

</div>

We seem to be having this in 2.02.20? It’s been happening on and off for a long time but I mostly ignored it. Finally bothered to look it up and see if anyone else had had the issue and found this thread. I’m not sure if it’s inconsistent or if there is something that triggers it like saving a script file during reload or something. I just suspect that because I don’t think it has been happening to non programmers on the team.

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [November 15, 2024, 4:34am UTC](https://qa.fmod.com/t/unity-locksup-infinitely-with-domain-reload-as-well-as-err-memory-leak-issue/17167/8 "2024-11-15T04:34:27Z")

</div>

Hi,

Thank you for sharing the information.

Unfortunately, I was not able to reproduce the issue from my end.

Could I grab the version number of your Unity? Additionally, could you please confirm if you are using any custom code that interacts with the FMOD Editor directly(e.g., editor scripts, tools, or extensions)?

> [@flaxenflash](#):
>
> I’m not sure if it’s inconsistent or if there is something that triggers it like saving a script file during reload or something.

Would it be possible to elaborate on this please?
