<div dir="ltr">Hi there,<div><br></div><div>We are using gstreamer in embedded Linux environment, and its memory usage exceeds our limit when playing large m4a audio files. After investigation, it seems that the memory usage is somewhat proportional to the size of the m4a file. I also did some experiments in desktop Linux environment, and the results were similar. In particular, I first tried a 87MB file, and gstreamer used about 16MB memory:</div>
<div><br></div><div><div>"lei@lei-OptiPlex-390:/media/LEI$ gst-launch-0.10 playbin uri=file:///media/LEI/White_Noise_320kbps_1Hour.m4a &</div><div>[1] 23790</div><div>lei@lei-OptiPlex-390:/media/LEI$ Setting pipeline to PAUSED ...</div>
<div>Pipeline is PREROLLING ...</div><div>Pipeline is PREROLLED ...</div><div>Setting pipeline to PLAYING ...</div><div>New clock: GstPulseSinkClock</div><div>lei@lei-OptiPlex-390:/media/LEI$ cat /proc/23790/statm</div><div>
32565 4003 1328 7 0 11705 0</div><div>"</div><div><br></div></div><div>I then tried a 609MB file, and gstreamer used over 50MB memory:<br></div><div><br></div><div><div>"lei@lei-OptiPlex-390:/media/LEI$ killall gst-launch-0.10 <br>
</div><div>lei@lei-OptiPlex-390:/media/LEI$ gst-launch-0.10 playbin uri=file:///media/LEI/White_Noise_320kbps_7Hour.m4a &</div><div>[2] 23826</div><div>[1] Terminated gst-launch-0.10 playbin uri=file:///media/LEI/White_Noise_320kbps_1Hour.m4a</div>
<div>lei@lei-OptiPlex-390:/media/LEI$ Setting pipeline to PAUSED ...</div><div>Pipeline is PREROLLING ...</div><div>Pipeline is PREROLLED ...</div><div>Setting pipeline to PLAYING ...</div><div>New clock: GstPulseSinkClock</div>
<div>lei@lei-OptiPlex-390:/media/LEI$ </div><div>lei@lei-OptiPlex-390:/media/LEI$ cat /proc/23826/statm</div><div>41648 13086 1328 7 0 20788 0</div><div>lei@lei-OptiPlex-390:/media/LEI$ cat /proc/23826/statm</div><div>41648 13086 1328 7 0 20788 0</div>
</div><div>"</div><div><br></div><div>I also tried pretty recent gstreamer 1.2 and various aac decoder elements. Results were the same. Below are the stats provided by tracelib. It looks like some of the pads had buffers whose size is proportional to the file size.</div>
<div><br></div><div><div>"lei@lei-OptiPlex-390:~/Documents/gst-tracelib$ LD_PRELOAD=src/.libs/libgsttracelib.so gst-launch-0.10 playbin uri=file:///media/LEI/White_Noise_320kbps_7Hour.m4a</div><div>Setting pipeline to PAUSED ...</div>
<div>Pipeline is PREROLLING ...</div><div>Pipeline is PREROLLED ...</div><div>Setting pipeline to PLAYING ...</div><div>New clock: GstPulseSinkClock</div><div>^CCaught interrupt -- handling interrupt.</div><div>Interrupt: Stopping pipeline ...</div>
<div>Execution ended after 5256616552 ns.</div><div>Setting pipeline to PAUSED ...</div><div>Setting pipeline to READY ...</div><div>Setting pipeline to NULL ...</div><div>Freeing pipeline ...</div><div><br></div><div>Overall Statistics:</div>
<div>Number of Threads: 5</div><div>Number of Elements: 17</div><div>Number of Bins: 4</div><div>Number of Pads: 31</div><div>Number of GhostPads: 4</div><div>Number of Buffers passed: 7068</div><div>Number of Events sent: 82</div>
<div>Number of Message sent: 16</div><div>Number of Queries sent: 0</div><div>Time: 0:00:05.371006122</div><div>Avg/Max CPU load: 8 %, 58 %</div><div>Max QOS ratio: 0 %</div><div>Max Memory usage: 1562416 kb</div><div><br>
</div><div>Thread 0xb2e03ac0 Statistics:</div><div> Time: 0:00:00.102057797, 1 %</div><div> Avg/Max CPU load: 0 %, 58 %</div><div> Pad Statistics:</div><div>Thread 0x84b8b50 Statistics:</div><div> Time: 0:00:00.186786480, 3 %</div>
<div> Avg/Max CPU load: 0 %, 0 %</div><div> Pad Statistics:</div><div> < faad0_sink : buffers 364 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) 353/ 559/ 598, time 0:00:05.198284149, bytes/sec 39142.916041</div>
<div> > decodebin0_src0 : buffers 363 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.194604287, bytes/sec 286229.309848</div><div> > faad0_src : buffers 363 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.194604287, bytes/sec 286229.309848</div>
<div> > selector_audio_src0_src : buffers 363 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.194606439, bytes/sec 286229.191270</div><div> < preroll_audio_src0_sink : buffers 363 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.194606439, bytes/sec 286229.191270</div>
<div> > preroll_audio_src0_src : buffers 232 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.193298109, bytes/sec 182980.445192</div><div> < abin_sink : buffers 232 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.193298109, bytes/sec 182980.445192</div>
<div> > aconv_src : buffers 232 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.192087403, bytes/sec 183023.113103</div><div> < aresample_sink : buffers 232 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.192087403, bytes/sec 183023.113103</div>
<div> > aresample_src : buffers 232 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.191095777, bytes/sec 183058.074985</div><div> < volume_sink : buffers 232 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.191095777, bytes/sec 183058.074985</div>
<div> > volume_src : buffers 232 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.189524125, bytes/sec 183113.514286</div><div> < audiosink_sink : buffers 232 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) ......./ 4096/......., time 0:00:05.189524125, bytes/sec 183113.514286</div>
<div>Thread 0x85d7ea0 Statistics:</div><div> Time: 0:00:00.037589903, 0 %</div><div> Avg/Max CPU load: 0 %, 7 %</div><div> Pad Statistics:</div><div> < decodebin0_sink : buffers 386 (ro 0,pre 0,dis 0,gap 0,dlt 0), size (min/avg/max) 16/ 22973/8682999, time 0:00:05.258568138, bytes/sec 1686310.373335</div>
<div> < typefind_sink : buffers 386 (ro 0,pre 0,dis 0,gap 0,dlt 0), size (min/avg/max) 16/ 22973/8682999, time 0:00:05.258568138, bytes/sec 1686310.373335</div><div> > typefind_src : buffers 386 (ro 0,pre 0,dis 0,gap 0,dlt 0), size (min/avg/max) 16/ 22973/8682999, time 0:00:05.258568513, bytes/sec 1686310.253081</div>
<div> < qtdemux0_sink : buffers 386 (ro 0,pre 0,dis 0,gap 0,dlt 0), size (min/avg/max) 16/ 22973/8682999, time 0:00:05.258568513, bytes/sec 1686310.253081</div><div>Thread 0x84b88f0 Statistics:</div>
<div> Time: 0:00:00.118386171, 2 %</div><div> Avg/Max CPU load: 0 %, 0 %</div><div> Pad Statistics:</div><div> > qtdemux0_audio_00 : buffers 380 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) 353/ 559/ 598, time 0:00:05.230470559, bytes/sec 40612.024789</div>
<div> < queue0_sink : buffers 380 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) 353/ 559/ 598, time 0:00:05.230470559, bytes/sec 40612.024789</div><div> > queue0_src : buffers 364 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) 353/ 559/ 598, time 0:00:05.230114535, bytes/sec 38904.692935</div>
<div> < aacparse0_sink : buffers 364 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) 353/ 559/ 598, time 0:00:05.230114535, bytes/sec 38904.692935</div><div> > aacparse0_src : buffers 364 (ro 0,pre 0,dis 1,gap 0,dlt 0), size (min/avg/max) 353/ 559/ 598, time 0:00:05.198284149, bytes/sec 39142.916041</div>
<div>Thread 0xad603e00 Statistics:</div><div> Time: 0:00:00.020254538, 0 %</div><div> Avg/Max CPU load: 0 %, 0 %</div><div> Pad Statistics:</div><div><br></div><div>Element Statistics:</div><div> GstTypeFindElement:typefind : buffers in/out 386/ 386 bytes in/out 8903581/ 8903581 first activity 0:00:00.023557397, ev/msg/qry sent 1/ 0/ 0</div>
<div> GstQTDemux:qtdemux0 : buffers in/out 386/ 380 bytes in/out 8903581/ 220494 first activity 0:00:00.023603848, ev/msg/qry sent 3/ 2/ 0</div><div> GstQueue:queue0 : buffers in/out 380/ 364 bytes in/out 220494/ 211195 first activity 0:00:00.051741935, ev/msg/qry sent 4/ 0/ 0</div>
<div> GstBaseParse:aacparse0 : buffers in/out 364/ 364 bytes in/out 211195/ 211195 first activity 0:00:00.051859689, ev/msg/qry sent 3/ 0/ 0</div><div> GstAudioDecoder:faad0 : buffers in/out 364/ 363 bytes in/out 211195/ 1486848 first activity 0:00:00.083756439, ev/msg/qry sent 11/ 0/ 0</div>
<div> GstStreamSelector:selector_audio_src0 : buffers in/out -/ 363 bytes in/out -/ 1486848 first activity 0:00:00.087758125, ev/msg/qry sent 11/ 0/ 0</div><div> GstQueue:preroll_audio_src0 : buffers in/out 363/ 232 bytes in/out 1486848/ 950272 first activity 0:00:00.087758126, ev/msg/qry sent 12/ 0/ 0</div>
<div> GstBaseTransform:aconv : buffers in/out -/ 232 bytes in/out -/ 950272 first activity 0:00:00.089136064, ev/msg/qry sent 12/ 0/ 0</div><div> GstBaseTransform:aresample : buffers in/out 232/ 232 bytes in/out 950272/ 950272 first activity 0:00:00.089136065, ev/msg/qry sent 12/ 0/ 0</div>
<div> GstBaseTransform:volume : buffers in/out 232/ 232 bytes in/out 950272/ 950272 first activity 0:00:00.090205748, ev/msg/qry sent 12/ 0/ 0</div><div><br></div><div>Bin Statistics:</div>
<div> GstDecodeBin:decodebin0 : buffers in/out 363/ 386 bytes in/out 1486848/ 8903581 first activity 0:00:00.023557396, ev/msg/qry sent 22/ 5/ 0</div><div> GstPlayBin:playbin0 : buffers in/out -/ - bytes in/out -/ - first activity 0:00:00.023557396, ev/msg/qry sent 82/ 16/ 0</div>
<div> GstBin:abin : buffers in/out 232/ - bytes in/out 950272/ - first activity 0:00:00.087849537, ev/msg/qry sent 37/ 7/ 0</div><div> GstAutoAudioSink:audiosink : buffers in/out 232/ - bytes in/out 950272/ - first activity 0:00:00.091847714, ev/msg/qry sent 1/ </div>
</div><div>"</div><div><br></div><div>Does anybody have any insights on what might be happening? The files I used are available at <a href="https://dl.dropboxusercontent.com/u/54923483/White_Noise_320kbps_1Hour.m4a">https://dl.dropboxusercontent.com/u/54923483/White_Noise_320kbps_1Hour.m4a</a> and <a href="https://dl.dropboxusercontent.com/u/54923483/White_Noise_320kbps_7Hour.m4a">https://dl.dropboxusercontent.com/u/54923483/White_Noise_320kbps_7Hour.m4a</a> .</div>
<div><br></div><div>Thanks,</div><div><br></div><div>LM</div></div>