pedroSG94 / RootEncoder-iOS

RootEncoder iOS (rtmp-rtsp-stream-client-swift) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP and SRT with all code written in Swift
Apache License 2.0
125 stars 34 forks source link

Fix memory leaks in Socket #40

Closed vitkuzmenko closed 3 months ago

vitkuzmenko commented 3 months ago

Context

When streaming, the use of outputBuffer.removeFirst(data.count) does not effectively free memory, which can lead to inefficiencies.

Change

Based on advice from an Apple Engineer, I replaced removeFirst with removeSubrange to optimize memory usage.

Before

Screenshot 2024-08-19 at 16 06 12

After

Screenshot 2024-08-19 at 16 08 06
pedroSG94 commented 3 months ago

Thank you! Merged