@DREBOTgs Do you have your Editor log? I feel like that may be more useful in tracking down the issue since the actual leak would happen well before the error occurs.
You can find it at %LOCALAPPDATA%\Unity\Editor\Editor.log on Windows.
Not sure if it’s exactly the same issue, but one way this reliably happens to me is if I have Unity script changes set as “Stop Playing And Recompile”, and then during Play Mode I change something in a script.
That always results in FMOD grabbing more and more memory until I get the ERR_MEMORY message.
To our knowledge the FMOD_ERR_MEMORY error due to transitioning between play-in-editor and editor has been fixed. Can you provide some steps to reproduce it now?
If you create your own FMOD::System or FMOD::Studio::System using our C# API (not fetching ours via RuntimeManager), that may be a vector for this issue if you aren’t cleaning those objects up on transition.
I’m still very new to fmod but I think I’m using it pretty in a pretty simple way through components (fmod studio event emitter) and from code via: FMODUnity.RuntimeManager.PlayOneShot(StartQuestEventName);
Where StartQuestEventName is like this:
[FMODUnity.EventRef]
public string StartQuestEventName = "event:/SFX/UI/Objective";
All that usage is fine and shouldn’t cause any problems regarding the ERR_MEMORY issue. Could you detail steps for us to follow to cause the error you are seeing?
I’m sorry but as described in previous posts it happens after multiple times entering/leaving playmode.
I’d say between 20 and 30 times but I cannot replicate consistently. The last 2 days I completely disable the live play in editor and it seems that it’s occurring less often than before.
I understand that without a clear reproduce step you will not be able to investigate but next time it occurs I’ll send the stack trace
I have been trying to replicate this crash for the past few days with no success. I have attempted with Unity 2019.4 and Unity 2020.1 with FMOD Studio 2.01. Large Unity projects, small Unity projects, blank Unity projects, all have been entering and exiting PIE mode 30+ times each and no issues have been found.
I suspect there may be something specific in the game code being run in your instance that is preventing the FMOD system from being cleaned up properly, and re-entering PIE mode will create a new system instance.
If at all possible, could you please find a way to replicate this in a smaller project that you can send over? Even if it is not reproducible reliably, if it can occur in one project that you can send over, we can really hammer it to see what could be going wrong. Thanks for your patience with this difficult issue.
Just to add that this is happening to me on a regular basis.
I updated to FMOD 2.01.07 and running Unity 2019.4.7f1 but it still happens.
It happens after about 5 or 6 Play/Stop sessions pretty regularly. Sometimes the music just keeps playing and I can keep working in the editor but then once I press Play again, it will crash.
Is there a way to temporarily kill all Fmod instanced between play/stop?
Also if helpful, here is one of the many Editor.Log stack trace showing what is happening to FMOD:
As mentioned previously, we’ve unfortunately been unable to replicate it here. The stacktrace you’ve provided can’t tell us much without some internal debugging. Are you able to share the project this happens in?
Unfortunately, it’s not easy to share the project.
I do have my own custom ‘Editor’ version of FMOD (copied from EditorUtils.cs) that is being initialized on Load and maybe that is the culprit?
Here is the file, would love it if you could look at it. It was working fine until I updated FMOD to the latest version.Editor_FMODPreviewer.txt (4.8 KB)
Just to add, I commented it out and the problem still persists. This is REALLY frustrating and making it practically impossible to work. Any help would be very appreciated. I have a ton of crash logs if that helps in any way.
I’ve been informed that if you wish to use your own editor with FMOD you have to remove the system initializer and let the underlying Editor take care of it. Could you please try this and let me know if it helps?