[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mythtv-dev
Subject:    Re: [mythtv] Are there Memory leaks in 0.28 Mythfrontend?
From:       Roger James <roger () beardandsandals ! co ! uk>
Date:       2017-04-18 17:53:19
Message-ID: 15b82327e98.27a6.d4b3b9aee17a85f6bc878c68b3925db6 () beardandsandals ! co ! uk
[Download RAW message or body]

On 18 April 2017 5:10:14 pm Gary Buhrmaster <gary.buhrmaster@gmail.com> wrote:

> On Mon, Apr 17, 2017 at 11:14 PM, Anthony Giggins
> <seven@seven.dorksville.net> wrote:
>> I'm seeing more and more that memory is creeping up on the frontend process,
>> is this a known issue?
>
> I do not think it is known (otherwise it would be fixed),
> but one should also be aware that due to caching, the
> memory footprint of the frontend would be expected
> to slowly increase (to some value) the longer it is
> running, so what you are seeing may be "normal".
>
>> what troubleshooting do I need to provide to raise a bug? from previous
>> threads I think this required valgrind? but can someone confirm?
>
> valgrind is your friend to detect true memory leaks
> (as opposed to code not minimizing memory usage).
> Using it, is not always.
>
> To obtain useful results you may need to compile the
> frontend with the debugging options (-g and -O0).
> Typically, you want to use something like this:
>
> valgrind --leak-check=full --error-limit=no --show-reachable=yes
> --log-file=/tmp/valgrind.out /usr/local/bin/mythfrontend
>
> Lastly, Qt itself may be the cause of any memory
> leaks, and debugging Qt itself is far more challenging.
>

Another alternative if you are building using gcc is to use the built in 
leak sanitizer.

 ./configure --extra-ldflags=-fsanitize=leak

But to make this work you first need to modify mythtv/settings.pro as shown 
below (can someone push this up to github).


@@ -270,15 +270,17 @@ win32 {
# Globals in static libraries need special treatment on OS X
macx:QMAKE_CFLAGS_STATIC_LIB += -fno-common
-# figure out compile flags based on qmake info
+# figure out compile and link flags based on qmake info
# qmake 4.8.2 & 4.8.3 messes up OSX "-arch i386 -arch x86_64"
# clang 3.0 on Linux does not like duplicate arguments.
macx {
QMAKE_CFLAGS += $$CPPFLAGS $$CFLAGS
QMAKE_CXXFLAGS += $$CXXPPFLAGS $$ECXXFLAGS
+ QMAKE_LFLAGS += $$LDFLAGS
} else {
QMAKE_CFLAGS *= $$CPPFLAGS $$CFLAGS
QMAKE_CXXFLAGS *= $$CXXPPFLAGS $$ECXXFLAGS
+ QMAKE_LFLAGS *= $$LDFLAGS
}
profile:!win32:!macx:CONFIG += debug


This does not introduce any noticeable performance overhead. It prints a 
leak analysis to stdout on exit.

Roger


_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic