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 724816 - GstGLContext : Memory leak
GstGLContext : Memory leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-gl
git master
Other Linux
: Normal critical
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-20 18:54 UTC by Adrien SCH.
Modified: 2016-06-10 07:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Adrien SCH. 2014-02-20 18:54:43 UTC
The GstGlContext isn't released correctly, and this behavior can cause multiple bugs, and of course memory saturation. 

Note : The following has been tested with the SW decoder and it worked.

Attached : a test program. 
video sample : http://www.auby.no/files/video_tests/h264_1080p_hp_4.1_10mbps_dts_unstyled_subs_monsters.mkv

Mailing list discussion : http://gstreamer-devel.966125.n4.nabble.com/Multiple-pipeline-with-OpenGL-and-vaapi-elements-td4665379.html#a4665399
Comment 1 Matthew Waters (ystreet00) 2014-02-21 04:44:19 UTC
commit 41de8900b8323696d0b434096d56eab0321d2256
Author: Matthew Waters <ystreet00@gmail.com>
Date:   Fri Feb 21 15:25:22 2014 +1100

    filter: free our data
    
    plugs some memory leaks
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724816
Comment 2 Adrien SCH. 2014-02-21 08:33:51 UTC
The following cases aren't solved : 

gst-launch-1.0 gltestsrc ! glcolorscale ! glimagesink -e

gst-launch-1.0 filesrc location=file ! matroskademux ! h264parse ! vaapidecode ! glcolorscale ! videoconvert ! xvimagesink -e 

The following case is solved : 
gst-launch-1.0 videotestsrc ! glcolorscale ! videoconvert ! xvimagesink
(ans subcase : gst-launch-1.0 filesrc location=file ! matroskademux ! h264parse ! avdec_h264 ! glcolorscale ! videoconvert ! xvimagesink -e )
Comment 3 Adrien SCH. 2014-02-21 11:04:56 UTC
Additional information : 

The following pipeline 
filesrc location=file ! matroskademux ! h264parse
! avdec_h264 ! glcolorscale ! videoconvert ! xvimagesink -e still generate the segmentation fault : Maximum number of clients reached. 

Test application : 
http://pastebin.com/H6cZqUpp

Observations : 
As said previously, the GstGlContext is CORRECTLY released in this case, but the display may be still open after this release.
Comment 4 Matthew Waters (ystreet00) 2014-02-22 14:53:20 UTC
This fixes the gltestsrc ! glcolorscale ! glimagesink case for me (and all subcases)

commit 7ab354d645251d1a51c967979c4a8f8bfdbdd93f
Author: Matthew Waters <ystreet00@gmail.com>
Date:   Sun Feb 23 01:32:23 2014 +1100

    fixup a memory leak of the context in the GLTextureUploadMeta path
    
    gst_structure_get returns a reference to the object and we asked
    for another with gst_object_replace.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724816

As for the vaapidecode ! glcolorscale case, See https://bugzilla.gnome.org/show_bug.cgi?id=724957

I haven't looked at the display not being released yet.
Comment 5 Adrien SCH. 2014-02-24 10:16:07 UTC
Great job, all cases are solved on my side too.

I'm closing this bug, and created a new one for the Display hanlde (just to be more clear).
Comment 6 Joona Laine 2016-06-10 07:13:35 UTC
Hi,

I'm experiencing this again with GStreamer 1.8.1. I have an application where I change between IP camera streams using the following pipeline:

gst-launch-1.0 rtspsrc location=<> latency=0 ! rtph264depay ! h264parse ! queue ! vaapidecode ! glupload ! glcolorconvert ! gltransformation ! glimagesink

Everything works great, except that memory accumulates after each camera change and after a while I get "Maximum number of clients reached".

I cannot see the change you have done previously, of course this is an old thread and the GL stuff has changed since.

Any ideas? Please let me know if you need additional information.

I'm using Qt 5.5 for my application and atm I'm also using QtGStreamer 1.2. for pipeline construction (need to opt out of that, just haven't done that yet).

Thanks!
Comment 7 Matthew Waters (ystreet00) 2016-06-10 07:21:06 UTC
This is an old bug, please open a new bug with your issue.