You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling [FFmpegKitConfig clearSessions], only the sessionHistoryList is emptied, leaving sessionHistoryMap to leak and retain a reference to the FFmpegSession.
Notably, if you are using session execute callbacks , ffmpeg-kit will continue to leak FFmpegSession objects, even if you set [FFmpegKitConfig setSessionHistorySize:0]. I've noticed this behaviour in previous versions but didn't investigate further at the time and was happy enough to use the global callbacks. My use-case has shifted and I have concurrent ffmpeg sessions running for my application, so I took a further look. This affects asynchronous commands issued on another queue. lldb will not be able to point out any obvious leaks here.
Here's the situation without calling the newly added [FFmpegKitConfig clearSessions]:
and if you do decide to clear the session list:
Only if ([sessionHistoryList count] > sessionHistorySize) are entries removed when adding a new session. This means at least 1 session will always linger and leak, replacing the previous reference.
Based off this commit, I added a method call to clear out sessionHistoryMap. I can confirm that in my use-case, my leaks disappear once I call [FFmpegKitConfig clearSessions].
Environment
Platform: [macOS]
Architecture: [x86_64]
Version [v4.5]
Source branch [master, v4.5]
Xcode version [13.0]
The text was updated successfully, but these errors were encountered:
When calling
[FFmpegKitConfig clearSessions]
, only thesessionHistoryList
is emptied, leavingsessionHistoryMap
to leak and retain a reference to theFFmpegSession
.Sessions history list and map are added at https://github.com/tanersener/ffmpeg-kit/blob/5d11e79fc2734a7c61b741f3a729409a17b212e1/apple/src/FFmpegKitConfig.m#L115
Notably, if you are using session execute callbacks , ffmpeg-kit will continue to leak
FFmpegSession
objects, even if you set[FFmpegKitConfig setSessionHistorySize:0]
. I've noticed this behaviour in previous versions but didn't investigate further at the time and was happy enough to use the global callbacks. My use-case has shifted and I have concurrent ffmpeg sessions running for my application, so I took a further look. This affects asynchronous commands issued on another queue. lldb will not be able to point out any obvious leaks here.As a test, I issued a sample command to
+ (FFmpegSession*)executeAsync:(NSString*)command withExecuteCallback:(ExecuteCallback)executeCallback withLogCallback:(LogCallback)logCallback withStatisticsCallback:(StatisticsCallback)statisticsCallback onDispatchQueue:(dispatch_queue_t)queue
with non-null, empty blocks. I monitored and waited for the autoreleasepool and took some samples after successful return.Here's the situation without calling the newly added
[FFmpegKitConfig clearSessions]
:and if you do decide to clear the session list:
Only if
([sessionHistoryList count] > sessionHistorySize)
are entries removed when adding a new session. This means at least 1 session will always linger and leak, replacing the previous reference.Based off this commit, I added a method call to clear out
sessionHistoryMap
. I can confirm that in my use-case, my leaks disappear once I call[FFmpegKitConfig clearSessions]
.Environment
Platform: [macOS]
Architecture: [x86_64]
Version [v4.5]
Source branch [master, v4.5]
Xcode version [13.0]
The text was updated successfully, but these errors were encountered: