[FFmpeg-trac] #9082(avcodec:new): Memory leak while trancoding on GPU
FFmpeg
trac at avcodec.org
Thu Jan 28 17:43:53 EET 2021
#9082: Memory leak while trancoding on GPU
------------------------------------+-----------------------------------
Reporter: misko | Owner:
Type: defect | Status: new
Priority: normal | Component: avcodec
Version: git-master | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+-----------------------------------
Comment (by misko):
ASAN revealed nothing at all. It looks like some internal buffer growing
over time being deallocated as a whole when ffmpeg quits. This may the
reason why ASAN sees no leaks at exit. Here is the tail of the output
while running under ASAN:
{{{
frame=69503 fps= 25 q=33.0 Lq=33.0 q=36.0 size= 1776788kB time=00:46:22.12
bitrate=5231.8kbits/s speed= 1x
video:2953609kB audio:97801kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown
Input file #0
(udp://239.232.122.8:1234?sources=10.128.0.122&fifo_size=100000&timeout=2000000):
Input stream #0:0 (video): 139091 packets read (1384717898 bytes); 69505
frames decoded;
Input stream #0:1 (audio): 115908 packets read (55635840 bytes); 115908
frames decoded (133526016 samples);
Input stream #0:2 (audio): 204 packets read (313344 bytes);
Input stream #0:3 ((null)): 0 packets read (0 bytes);
Input stream #0:4 (subtitle): 0 packets read (0 bytes);
Input stream #0:5 ((null)): 0 packets read (0 bytes);
Input stream #0:6 (data): 32 packets read (49057 bytes);
Total: 255235 packets (1440716139 bytes) demuxed
Output file #0
(udp://239.232.229.254:10001?pkt_size=1316&fifo_size=100000):
Output stream #0:0 (video): 69503 frames encoded; 69503 packets muxed
(1728018257 bytes);
Output stream #0:1 (audio): 130396 frames encoded (133525504 samples);
130398 packets muxed (33382685 bytes);
Total: 199901 packets (1761400942 bytes) muxed
Output file #1
(udp://239.232.229.254:10002?pkt_size=1316&fifo_size=100000):
Output stream #1:0 (video): 69503 frames encoded; 69503 packets muxed
(864014249 bytes);
Output stream #1:1 (audio): 130396 frames encoded (133525504 samples);
130398 packets muxed (33382685 bytes);
Total: 199901 packets (897396934 bytes) muxed
Output file #2
(udp://239.232.229.254:10003?pkt_size=1316&fifo_size=100000):
Output stream #2:0 (video): 69503 frames encoded; 69503 packets muxed
(432462723 bytes);
Output stream #2:1 (audio): 130396 frames encoded (133525504 samples);
130398 packets muxed (33382685 bytes);
Total: 199901 packets (465845408 bytes) muxed
[AVIOContext @ 0x613000004800] Statistics: 0 seeks, 1421075 writeouts
[AVIOContext @ 0x6130000049c0] Statistics: 0 seeks, 750353 writeouts
[AVIOContext @ 0x613000004b80] Statistics: 0 seeks, 415249 writeouts
[h264_nvenc @ 0x619000076c80] Nvenc unloaded
[h264_nvenc @ 0x619000078a80] Nvenc unloaded
[h264_nvenc @ 0x61900007a880] Nvenc unloaded
[AVIOContext @ 0x613000003840] Statistics: 1678790932 bytes read, 0 seeks
=================================================================
==17126==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 20856 byte(s) in 3 object(s) allocated from:
#0 0x7fe137ead330 in __interceptor_malloc (/lib/x86_64-linux-
gnu/libasan.so.5+0xe9330)
#1 0x7fe106f6551a (<unknown module>)
Direct leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x7fe137ead330 in __interceptor_malloc (/lib/x86_64-linux-
gnu/libasan.so.5+0xe9330)
#1 0x7fe0e0bdaf3d (<unknown module>)
SUMMARY: AddressSanitizer: 20888 byte(s) leaked in 4 allocation(s).
}}}
I attached a plot of RSS over time. One is for commit 022a12b306 (the
leaky one) and the other for commit 8a81820624 (the good one). Measurement
went for straight 3 hours sampling RSS for particular process every 300
seconds.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9082#comment:11>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list