Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

[IOS] Memory leaks during argument parsing #17

Closed
tanersener opened this issue Sep 2, 2018 · 6 comments
Closed

[IOS] Memory leaks during argument parsing #17

tanersener opened this issue Sep 2, 2018 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@tanersener
Copy link
Owner

Argument parsing methods leaks memory. The following trace belongs to one of the leaks.

   0 libsystem_malloc.dylib malloc_zone_malloc
   1 libsystem_malloc.dylib realloc
   2 mobileffmpeg grow_array
   3 mobileffmpeg split_commandline
   4 mobileffmpeg ffmpeg_parse_options
   5 mobileffmpeg execute
   6 mobileffmpeg mobileffmpeg_execute

The actual cause is reusable nature of internal variables. FFmpeg executable does not perform a full cleanup on abnormal termination and exits without freeing some dynamic parts. But MobileFFmpeg does not call FFmpeg executable and some dynamic blocks remain unfreed.

A common solution is needed for both Android and IOS.

This issue was detected in v2.0 but it looks like all versions are affected from this.

@tanersener tanersener added bug Something isn't working enhancement New feature or request labels Sep 2, 2018
@tanersener tanersener self-assigned this Sep 2, 2018
@tanersener tanersener removed the bug Something isn't working label Sep 6, 2018
@tanersener
Copy link
Owner Author

tanersener commented Sep 7, 2018

A detailed analysis proves that successful command execution does not create new leaks, only commands returning a non-zero return value create leaks. The good thing is most of them are small in size, around 16 - 80 bytes per execution.

Additionally, most of them occur inside libavutil because memory allocation operations av_alloc/av_calloc/av_malloc/av_realloc/av_strdup are defined in libavutil/mem.c.

A solution is planned in middle-term.

The following screenshot is captured for IOS during command execution tests.

command_tab

Repository owner deleted a comment from github-actions bot May 9, 2020
@github-actions
Copy link

github-actions bot commented Jul 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions
Copy link

github-actions bot commented Sep 8, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions
Copy link

github-actions bot commented Nov 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions
Copy link

github-actions bot commented Jan 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant