MP4 muxer has continuously increasing memory usage
|Reported by:||Sesse||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
I'm muxing MP4 streams with -movflags empty_moov+frag_keyframe+default_base_moof -frag_duration 125000. It seems that memory usage is very slowly but surely increasing, by roughly 15 MB/day until I close the stream.
tcmalloc heap profiling seems to indicate that the culprit is the mov muxer. In particular, mov_add_tfra_entries() allocates a MOVFragmentInfo struct for each fragment, and never seems to clear them; 36 bytes every 125 ms is 25 MB/day, so it matches pretty well.
Is there a way to avoid this allocation? Given that this is a stream and not a file, I don't see how one needs to know about every fragment that has ever been output.