Memory leak in level element

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory leak in level element

Gst-Geek
All,

I am using level in pipeline to analyse the decoded audio frames. rms and decay values of the message are used in the application for quality report.

But I see memory leak in level element when post-messages is set to true.
Below pipeline issue is reproduces the issue. Check memory usage of gst-launch in top while running the pipeline, memory keeps in increasing.  

gst-launch-1.0 audiotestsrc ! level  interval=30000 ! fakesink --gst-debug=3
I have set low interval here to reproduce the issue faster here.

I checked gst_level_post_message and gst_level_message_append_channel function but I coun't pin point the issue.
Memory leak is seen even with level-example code.

Memory leak is not seen when post-messages set to false.

I ran pipeline through valgrind but it tool is also not reporting any issue.

I have following question:
1. Am I configuring level element wrongly?
2. If level element is configured properly. Are you able to see this issue ??
3. How to trace memory leak in the pipeline ?? any tools ??

 
~ Vinod
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak in level element

Stefan Sauer
On 11/30/2016 04:58 AM, Vinod Kesti wrote:
> All,
>
> I am using level in pipeline to analyse the decoded audio frames. rms and
> decay values of the message are used in the application for quality report.
top is not a good tool to diagnose leaks-.

>
> But I see memory leak in level element when post-messages is set to true.
> Below pipeline issue is reproduces the issue. Check memory usage of
> gst-launch in *top* while running the pipeline, memory keeps in increasing.  
>
> gst-launch-1.0 audiotestsrc ! level  interval=30000 ! fakesink --gst-debug=3
> I have set low interval here to reproduce the issue faster here.
>
> I checked gst_level_post_message and gst_level_message_append_channel
> function but I coun't pin point the issue.
> Memory leak is seen even with level-example code.
>
> Memory leak is not seen when post-messages set to false.
>
> I ran pipeline through valgrind but it tool is also not reporting any issue.
>
> I have following question:
> 1. Am I configuring level element wrongly?
> 2. If level element is configured properly. Are you able to see this issue
> ??
> 3. How to trace memory leak in the pipeline ?? any tools ??
I've checked with valgrind and there is no leak (besides small one-time
allocs), definitely nothing that grows:

I have this in my bashrc:
alias vg_memcheck='G_SLICE=always-malloc G_DEBUG=gc-friendly
GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1 valgrind --tool=memcheck
--trace-children=yes --num-callers=20 --read-var-info=yes
--leak-check=full --leak-resolution=high --track-origins=yes'

and then run

vg_memcheck gst-launch-1.0 audiotestsrc num-buffers=100 ! level
post-messages=true interval=30000 ! fakesink

Stefan

>
>  
> ~ Vinod
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Memory-leak-in-level-element-tp4680952.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak in level element

Gst-Geek
This post was updated on .
Hi Stefan,

Valgrind is not reporting any memory leak for the mentioned pipeline.

But when I run it for log time, memory leak is seen. Memory keeps increasing, swap memory is also increasing after 90% memory.

I checked memory usage through /proc/meminfo, free and ps. In all command I see memory increase.

~ Vinod  
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak in level element

Stefan Sauer
On 12/01/2016 06:02 PM, Vinod Kesti wrote:
> Hi Stefan,
>
> Valgrind is reporting any memory leak for the mentioned pipeline.
>
> But when I run it for log time, memory leak is seen. Memory keeps
> increasing, swap memory is also increasing after 90% memory.
Please share the valgrind log (e.g. put it on a pastbin site and include
the link). Please look for 'definitely lost' entries and those where it
is > 1 block, since that could be a reoccuring leak which would cause a
growth in memory use.

I just retested:
vg_memcheck gst-launch-1.0 audiotestsrc num-buffers=1000 ! level
post-messages=true interval=30000 ! fakesink
...
==26201== LEAK SUMMARY:
==26201==    definitely lost: 16,384 bytes in 1 blocks
==26201==    indirectly lost: 0 bytes in 0 blocks
==26201==      possibly lost: 610 bytes in 4 blocks
==26201==    still reachable: 43,134 bytes in 685 blocks
==26201==         suppressed: 480,576 bytes in 1,363 blocks

no growith leak. But I can confirm that top/htop shows a growth in
memory usage if post-messages=true.
Maybe file a bug with these information. Next step would be to review
the code and check if we're actually leaking, or if e.g. we're just
queueing up messages.

Stefan

>
> I checked memory usage through /proc/meminfo, free and ps. In all command I
> see memory increase.
>
> ~ Vinod  
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Memory-leak-in-level-element-tp4680952p4680982.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel