Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory and performance leak #5

Open
ludzeller opened this issue Dec 27, 2024 · 0 comments
Open

Memory and performance leak #5

ludzeller opened this issue Dec 27, 2024 · 0 comments

Comments

@ludzeller
Copy link

ludzeller commented Dec 27, 2024

I think there is memory leak in your UniVoiceAudioSourceOutput.cs class, the segments Dictionary grew in size quickly for me, several thousands stale entries after only some minutes if I remember correctly. Since you call LINQ in it very often that lead to severe performance issues after 10 minutes or so on Meta Quest 3.

I fixed it in my repo, this is the last of the commits that fixed it:
SphericalLabs/OpenSoundLab@9ec81ed#diff-ca7e8cba7d09de800d5d4fbca961b12c7ad8854503da0679b1777ca0cff2967d

After that I went on to rewrite that class completely so that it avoids the CircularBuffer and runs directly on the audio thread, which in my case is desireable. So far it seems to run quite well:
https://github.com/SphericalLabs/OpenSoundLab/blob/master/Assets/UniVoiceAssets/Adrenak.UniVoice.AudioSourceOutput/Runtime/UniVoiceAudioSourceOutput.cs

Please let me know if you can confirm that performance leak and let me know if you want to incorporate the script in your library. I am happy to share it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant