[Interest] How to inspect a Qt Application memory usage?

Michael Jackson mike.jackson at bluequartz.net
Mon Oct 22 21:14:56 CEST 2018


Doesn't Xcode come with the "Instruments" application which is designed to do the things that OP is asking about? I have used it in the past for function timing and some memory issues but it has been a few years.

--
Michael Jackson | Owner, President
      BlueQuartz Software
[e] mike.jackson at bluequartz.net
[w] www.bluequartz.net <http://www.bluequartz.net>

On 10/22/18, 12:26 PM, "Interest on behalf of Elvis Stansvik" <interest-bounces+mike.jackson=bluequartz.net at qt-project.org on behalf of elvstone at gmail.com> wrote:

    Den mån 22 okt. 2018 kl 18:04 skrev Nuno Santos <nunosantos at imaginando.pt>:
    >
    > Elvis,
    >
    > I have just tried that it resulted in this. I’m not familiar with valgrind output. Does this look good to you?
    >
    >
    > --45024-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
    > --45024-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 2 times)
    > --45024-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 4 times)
    > --45024-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 8 times)
    > QML debugging is enabled. Only use this in a safe environment.
    > ==45024==
    > ==45024== Process terminating with default action of signal 11 (SIGSEGV)
    > ==45024==  Access not within mapped region at address 0x18
    > ==45024==    at 0x1077D6E3A: _pthread_wqthread (in /usr/lib/system/libsystem_pthread.dylib)
    > ==45024==    by 0x1077D6BE8: start_wqthread (in /usr/lib/system/libsystem_pthread.dylib)
    > ==45024==  If you believe this happened as a result of a stack
    > ==45024==  overflow in your program's main thread (unlikely but
    > ==45024==  possible), you can try to increase the size of the
    > ==45024==  main thread stack using the --main-stacksize= flag.
    > ==45024==  The main thread stack size used in this run was 8388608.
    > --45024:0:schedule VG_(sema_down): read returned -4
    > ==45024==
    > [1]    45024 segmentation fault  valgrind --tool=massif XPTO.app
    
    Hm, I'm not too familiar with valgrind output, but that looks like the
    application crashed due to an access violation. Perhaps you should run
    it in a memory error checker first to make pinpoint the violation?
    Valgrind has one called memcheck (--tool=memcheck).
    
    Elvis
    
    >
    > Thx!
    >
    > Nuno
    >
    > On 22 Oct 2018, at 16:54, Elvis Stansvik <elvstone at gmail.com> wrote:
    >
    > I used valgrind with valgrind --tool=massif myApp to track down a memory issue just today actually, and it worked out great, but I don't know if it works on macOS (this was on Linux). I used massif-visualizer for visualization.
    >
    > I've been meaning to check out heaptrack but haven't gotten around to it.
    >
    > Elvis
    >
    > Den mån 22 okt. 2018 16:50Nuno Santos <nunosantos at imaginando.pt> skrev:
    >>
    >> Hi,
    >>
    >> What tool(s) do you people suggest in order to investigate where is the memory being spent on a Qt application?
    >>
    >> Thanks!
    >>
    >> Nuno
    >> _______________________________________________
    >> Interest mailing list
    >> Interest at qt-project.org
    >> http://lists.qt-project.org/mailman/listinfo/interest
    >
    >
    _______________________________________________
    Interest mailing list
    Interest at qt-project.org
    http://lists.qt-project.org/mailman/listinfo/interest
    





More information about the Interest mailing list