After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744977 - glvideomixer: severe memory leak
glvideomixer: severe memory leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-22 18:37 UTC by Vasilis Liaskovitis
Modified: 2015-02-23 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix transfer pbo memory leak (728 bytes, patch)
2015-02-23 15:19 UTC, Vasilis Liaskovitis
committed Details | Review

Description Vasilis Liaskovitis 2015-02-22 18:37:26 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
Comment 1 Topolsky 2015-02-23 08:58:26 UTC
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
Comment 2 Vasilis Liaskovitis 2015-02-23 15:19:22 UTC
Created attachment 297675 [details] [review]
fix transfer pbo memory leak
Comment 3 Sebastian Dröge (slomo) 2015-02-23 16:43:43 UTC
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 4 Sebastian Dröge (slomo) 2015-02-23 16:44:09 UTC
Comment on attachment 297675 [details] [review]
fix transfer pbo memory leak

Thanks for the patch!