google / universal-dash-transmuxer

UDT (Dash Transmuxer) Project: Can transmux DASH -> HLS or other formats.
http://www.google.com
Apache License 2.0
54 stars 25 forks source link

[iOS] Memory usage issues related to DashToHls_ReleaseHlsSegment #5

Closed Uragawa closed 8 years ago

Uragawa commented 8 years ago

I don't know whether this is true of other/all STL implementations, but on iOS at least (tested on SDK 8.4 in C++98 mode), vector assignment preserves capacity if the LHS is larger than the RHS. Therefore, when an empty vector is assigned to the desired position within DashToHls_ReleaseHlsSegment(), no actual deallocation takes place. This quickly builds up to hundreds of Megabytes, and eventually iOS will kill the application for using too much memory.

Compiling in C++11 mode solves the problem (if this is a feature of C++11, it'd be nice to require C++11 compatibility); so does using std::map's erase() to remove the element.

justsomeguy-google-com commented 8 years ago

It does appear that Apple has a bug with C++98. I'd recommend using C++11 or higher.

SeawardT commented 8 years ago

Did this resolve your issue when using C++11?