Possible memory leak in souphttpsrc

Sameer Naik sameer.subscriptions at damagehead.com
Wed Jun 6 02:49:23 PDT 2012


Hello,

I am using the gstreamer on a fedora 15 system that has the following
gstreamer packages installed.

 - gstreamer-0.10.34
 - gst-plugins-base-0.10.34
 - gst-plugins-good-0.10.29

The libsoup version in use is libsoup-2.34.3-1

I noticed very high memory usage by gstreamer/plugins while sourcing
the stream using souphttpsrc. I built a test pipeline to figure out
the source of the problem. The pipeline looks something like this:
souphttpsrc > queue2 > appsink

For the tests i used the following media file:
http://download.damagehead.com/samples/bbb.mp4. For all test cases the
maximum buffer size set on the queue2 element is 10M and the appsink
is configured to hold atmost 1 buffer at any point in time.

Case 1:
-----------
Here i am streaming the file over the internet via http.

gst-launch souphttpsrc
location=http://download.damagehead.com/samples/bbb.mp4 ! queue2
use-buffering=1 max-size-buffers=0 max-size-time=0
max-size-bytes=10485760 ! appsink max-buffers=1

When this pipeline is executed, is see the memory consumption is 36m
(and eventually 40m) when the buffering percentage reaches 100%.

Case 2:
-----------
Here i am streaming the file over the local network (high speed) via
http. The difference between Case 1 and Case 2 are essentially the
download rate.

gst-launch souphttpsrc location=http://localhost/media/bbb.mp4 !
queue2 use-buffering=1 max-size-buffers=0 max-size-time=0
max-size-bytes=10485760 ! appsink max-buffers=1

When this pipeline is executed, is see the memory consumption is 20m
when the buffering percentage reaches 100%.

Case 3:
----------
Here i am playing the file using filesrc, i.e. local file playback

gst-launch filesrc location=/opt/media/bbb.mp4 ! queue2
use-buffering=1 max-size-buffers=0 max-size-time=0
max-size-bytes=10485760 ! appsink max-buffers=1

When this pipeline is executed, is see the memory consumption is 18m
when the buffering percentage reaches 100%.
---

For Case 2 and 3 the buffering percentage reaches 100% almost
immediately. As it can be seen the memory consumption of case 1 is way
off when compared to that of case 2 and 3.

I replaced souphttpsrc with neonhttpsrc for cases 1 and 2 and note
cases show consistent memory usage of 19m.

There seems to be something horribly wrong with souphttpsrc or maybe
with the underlying libsoup library.

Note:
 - Reported memory usage numbers were taken from the RSS field of the
top command output.
 - The above tests were completed on x86 Fedora 15 OS.
 - I have also tested the above 3 case with the latest stable versions
of gstreamer-0.10 and am seeing the exact sample behaviour.

Thanks and Regards
~Sameer


More information about the gstreamer-devel mailing list