GNOME Bugzilla – Bug 744977
glvideomixer: severe memory leak
Last modified: 2015-02-23 16:44:09 UTC
glvideomixer leaks memory when feeding into a capsfilter, or when feeding into a non-gl based sink. Pipeline eats up most of system memory eventually (as reported by e.g. vmstat / free). gst-launch-1.0 uridecodebin uri=file:///opt/Videos/test.avi ! glvideomixer ! video/x-raw, width=1280, height=720 ! glimagesink GST_DEBUG=4 log: http://pastebin.com/yy2yTT1Q valgrind: http://pastebin.com/Cyg6DU1y or: gst-launch-1.0 uridecodebin uri=file:///opt/Videos/test.avi ! glvideomixer ! video/x-raw, width=1280, height=720 ! autovideosink where autovideosink defaults to xvimagesink on this platform (i.e. not glimagesink). GST_DEBUG=4 log: http://pastebin.com/mUKMXxXk valgrind: http://pastebin.com/cxXkcQnW Leak also happens without a caps element, as long as glvideomixer feeds into non-gl sink (autovideosink): gst-launch-1.0 uridecodebin uri=file:///opt/Videos/test.avi ! glvideomixer ! autovideosink GST_DEBUG=4 log: http://pastebin.com/kP1irDRt in this case memory usage increases at a slower rate than previous pipelines, but is still visible. Pipeline "gst-launch-1.0 uridecodebin uri=file:///opt/Videos/test.avi ! glvideomixer ! glimagesink" does not appear to leak memory. Identical pipelines with compositor instead of glviodemixer element also do not leak. There are a lot of the following debug messages in the leaking cases: "glmixer gstglmixer.c:1148:gst_gl_mixer_process_textures: Output Buffer does not contain correct memory, attempting to wrap for download" Perhaps the leaks and extra memory allocations happen only when downloading / uploading some pbo or other object due to inappropriate memory type? Tested with master repos from 22/2/2015
Tested the given pipelines from Vasilis - the results are the same as described. The memory leak happens using gstreamer from git master from 10/2/2015 The memory leak occures for me also with videotestsrc gst-launch-1.0 videotestsrc ! glvideomixer ! video/x-raw, width=1280, height=720 ! ximagesink The leak happend also without caps but its much slower: gst-launch-1.0 videotestsrc ! glvideomixer ! ximagesink
Created attachment 297675 [details] [review] fix transfer pbo memory leak
commit c55689ad1681fa7807b32f5e179700f537dff497 Author: Vasilis Liaskovitis <vliaskov@gmail.com> Date: Mon Feb 23 16:13:31 2015 +0100 glmemory: Fix transfer_pbo memory leak https://bugzilla.gnome.org/show_bug.cgi?id=744977
Comment on attachment 297675 [details] [review] fix transfer pbo memory leak Thanks for the patch!