python memory leak

Sebastian Dröge sebastian at centricular.com
Wed Mar 16 08:06:40 UTC 2016


On Di, 2016-03-15 at 18:54 +0100, Bram Van Steenlandt wrote:
> Hi,
> 
> I have an application (rtsp camera viewing and recording) in python 
> using gstreamer 1.0.
> 
> It all works but I think one (or more) of the pipelines are leaking 
> memory, at first I thought the problem was related to the restarting of 
> the stream but this doesn't seem to be the case.
> It also doesn't happen (less camera and a more complicated pipeline with 
> an extra tcpclient) at all on one machine and on another machine (where 
> the load is higher) it happens "all the time" I think an external factor 
> causes the leak (corrupt jpeg stream, packet loss etc.)
> On the machine where it happens "all the time", I think the maximum time 
> without leaking is 6 hours I think, it also not every 6 hours, sometimes 
> it's less.
> 
> I now have a temporary fix where the application restarts when memory is 
> running out, this works but it's not ideal.
> I have 9 pipelines running, for another project I'm hoping to run 32 or 64.
> 
> Is there a way I can:
> -Find out how much memory one pipeline is taking up from python ? sizeof 
> didn't work
> -Tell a pipeline to limit it's memory consumption to a maximum amount 
> and "destroy" itself when it fails to do so.

Your pipeline looks relatively simple, so best would be to recreate a
testcase in C and then a) check if it still has increasing memory usage
and b) check with valgrind's massif where that memory is mostly
allocated.

If I understand you correctly the problem is that memory usage grows
over time and restarting the pipeline alone does not help? Unreffing
the pipeline neither? In that case, valgrind's memcheck might also
point you to memory leaks when exiting the application after a run.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160316/ddf4bce1/attachment-0001.sig>


More information about the gstreamer-devel mailing list