Opened 7 years ago
Closed 7 years ago
#6520 closed defect (fixed)
MP4 muxer has continuously increasing memory usage
Reported by: | Sesse | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | 3.2.4 | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Hi,
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.
According to wbs, fixed in 3.3 (which is unfortunately too new for me) if you add +skip_trailer to movflags.