Discussion:
Memory Leak in basic Gstreamer pipeline code.
Shrishty Deorari
2016-10-21 13:44:23 UTC
Permalink
Hi

I have a querry regarding the memory leak in the gstreamer pipeline.
I am trying to run a Gstreamer pipeline code in a loop:


The simpler version of my code: Reads the video file and displays on the
screen using xvimagesink.
Now for every Iteration or loop my memory increases by +.2 . This does'nt
seem such a big issue here but when I run this for a log run like over
night this memory leak issue becomes big.

I am doing gst_object_unref at all the possible places i could. Please have
a look at mini version of my whole program, here also problem is same.
Please let me know if I am missing to clear out any memory.

I have attached the File below.


*With Warm Regards,*

Shrishty Deorari

VVDN Technologies Pvt Ltd

*Cell : *+91 7773980237 | *Skype :* shrishty_vvdn
Arun Raghavan
2016-10-21 14:44:30 UTC
Permalink
Post by Shrishty Deorari
Hi
I have a querry regarding the memory leak in the gstreamer pipeline.
The simpler version of my code: Reads the video file and displays on the
screen using xvimagesink.
Now for every Iteration or loop my memory increases by +.2 . This does'nt
seem such a big issue here but when I run this for a log run like over
night this memory leak issue becomes big.
I am doing gst_object_unref at all the possible places i could. Please have
a look at mini version of my whole program, here also problem is same.
Please let me know if I am missing to clear out any memory.
I have attached the File below.
Did you try running the code under valgrind? Using that, and looking at
the definitely/indirectly lost entries is usually helpful. There will be
a number of false positives, some of which can be suppressed with the
suppressions file in the common/ directory in the gstreamer sources.

With a quick run of your code over 2 iterations, I see no leaks.

-- Arun
Shrishty Deorari
2016-10-24 09:46:53 UTC
Permalink
Hi,
I also tried with valgind using the follwoing command:
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind -v --tool=memcheck
--leak-check=full --num-callers=40 --log-file=valgrind.log ./gstapp

Where gstapp is my executable.

I have attached the valgrind logs.
I can see that the memory leak is happening at 3 places:
While creating the plugins and somewhere in GLIB.
Please check line number : 4769, 4787,5510.



*With Warm Regards,*

Shrishty Deorari

VVDN Technologies Pvt Ltd

*Cell : *+91 7773980237 | *Skype :* shrishty_vvdn
Post by Arun Raghavan
Post by Shrishty Deorari
Hi
I have a querry regarding the memory leak in the gstreamer pipeline.
The simpler version of my code: Reads the video file and displays on the
screen using xvimagesink.
Now for every Iteration or loop my memory increases by +.2 . This does'nt
seem such a big issue here but when I run this for a log run like over
night this memory leak issue becomes big.
I am doing gst_object_unref at all the possible places i could. Please have
a look at mini version of my whole program, here also problem is same.
Please let me know if I am missing to clear out any memory.
I have attached the File below.
Did you try running the code under valgrind? Using that, and looking at
the definitely/indirectly lost entries is usually helpful. There will be
a number of false positives, some of which can be suppressed with the
suppressions file in the common/ directory in the gstreamer sources.
With a quick run of your code over 2 iterations, I see no leaks.
-- Arun
Arun Raghavan
2016-10-24 10:09:22 UTC
Permalink
Post by Shrishty Deorari
Hi,
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind -v --tool=memcheck
--leak-check=full --num-callers=40 --log-file=valgrind.log ./gstapp
Where gstapp is my executable.
I have attached the valgrind logs.
While creating the plugins and somewhere in GLIB.
Please check line number : 4769, 4787,5510.
Those seem to be static initialisation (like the rest of the things in
the log).

Regards,
Arun
Nicolas Dufresne
2016-10-24 16:05:58 UTC
Permalink
Hi,
G_SLICE=always-malloc G_DEBUG=gc-friendly  valgrind -v --
tool=memcheck --leak-check=full --num-callers=40  --log-
file=valgrind.log ./gstapp
Where gstapp is my executable.
I have attached the valgrind logs.
While creating the plugins and somewhere in GLIB.
Please check line number : 4769, 4787,5510.
Try using a suppression file, there is a lot of false positive
otherwise.

https://cgit.freedesktop.org/gstreamer/common/tree/gst.supp
With Warm Regards,
Shrishty Deorari
VVDN Technologies Pvt Ltd
Cell : +91 7773980237 | Skype : shrishty_vvdn
Post by Shrishty Deorari
Post by Shrishty Deorari
Hi
I have a querry regarding the memory leak in the gstreamer
pipeline.
Post by Shrishty Deorari
The simpler version of my code: Reads the video file and displays
on the
Post by Shrishty Deorari
screen using xvimagesink.
Now for every Iteration or loop my memory increases by +.2 . This
does'nt
Post by Shrishty Deorari
seem such a big issue here but when I run this for a log run like
over
Post by Shrishty Deorari
night this memory leak issue becomes big.
I am doing gst_object_unref at all the possible places i could.
Please
Post by Shrishty Deorari
have
a look at mini version of my whole program, here also problem is
same.
Post by Shrishty Deorari
Please let me know if I am missing to clear out any memory.
I have attached the File below.
Did you try running the code under valgrind? Using that, and
looking at
the definitely/indirectly lost entries is usually helpful. There will be
a number of false positives, some of which can be suppressed with the
suppressions file in the common/ directory in the gstreamer
sources.
With a quick run of your code over 2 iterations, I see no leaks.
-- Arun
_______________________________________________
gstreamer-devel mailing list
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Loading...