# RuntimeManager allocates memory OnGUI even when Overlay Debug is disabled

**URL:** <https://qa.fmod.com/t/runtimemanager-allocates-memory-ongui-even-when-overlay-debug-is-disabled/14617>\
**Category:** Unity\
**Created:** [April 26, 2019, 2:49pm UTC](https://qa.fmod.com/t/runtimemanager-allocates-memory-ongui-even-when-overlay-debug-is-disabled/14617 "2019-04-26T14:49:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaobsneto](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joaobsneto/32/317_2.png) [@joaobsneto](https://qa.fmod.com/u/joaobsneto)\
**Post date:** [April 26, 2019, 2:49pm UTC](https://qa.fmod.com/t/runtimemanager-allocates-memory-ongui-even-when-overlay-debug-is-disabled/14617/1 "2019-04-26T14:49:44Z")

</div>

RuntimeManager allocates memory OnGUI even when Overlay Debug is disabled. I commented out the code, and it stopped to allocate memory every frame. Unity 2018.3.12f1 and FMOD 1.10.12.

```auto
        Rect windowRect = new Rect(10, 10, 300, 100);
        void OnGUI()
        {
            if (studioSystem.isValid() && Settings.Instance.IsOverlayEnabled(fmodPlatform))
            {
                windowRect = GUI.Window(0, windowRect, DrawDebugOverlay, "FMOD Studio Debug");
            }
        }
```

---

<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:** [April 30, 2019, 1:57am UTC](https://qa.fmod.com/t/runtimemanager-allocates-memory-ongui-even-when-overlay-debug-is-disabled/14617/2 "2019-04-30T01:57:50Z")

</div>

Thanks for getting in contact with us.

We already have some changes in place for the next release to remove the garbage collection overhead in the DebugOverlay.
