livekit / client-sdk-unity

Official Unity SDK for LiveKit
https://livekit.io
32 stars 13 forks source link

Memory leak on incoming audio #34

Open sus-taguchi-t opened 4 months ago

sus-taguchi-t commented 4 months ago

Hi. I am currently implementing an audio exchange and the audio communication is correct. However, I was experiencing memory leaks, so I did a little investigating.

I am calling the AudioStream constructor in the callback registered to the TrackSubscribed event of the Room class instance, but if I comment out that part, the memory leak goes away. In particular, I have confirmed that it is possible to reduce the memory leakage a little by changing the part of the OnAudioStreamEvent method of the AudioStream class that creates an instance of the AudioFrame class to a using statement. However, the memory leakage is not completely eliminated, so there may be other causes.

ivanovandrewx commented 1 week ago

Hi, I was wondering if there are any updates on this one — same issue with memory leak. 😢