Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Memory leak debuging

    General and Desktop
    4
    10
    203
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JoSchn last edited by

      Hi,
      I am new here. I am working on a Qt project version(QT5.6.3).

      It is a application for outputing text and graphical things.
      The main problem is: If the application runs for some hours, the memory increases, about 9MB per hour!
      Anybody ideas how to detect this problem, or any useful tools for detecting such problems?
      Thank you.

      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @JoSchn last edited by JonB

        @JoSchn
        Hello and welcome.

        Try valgrind, for which support is built into Qt Creator.

        Unless you are under Windows, where it's not available. And you don't mention compiler. Without knowing either of which nobody can advise you.

        1 Reply Last reply Reply Quote 1
        • J
          JoSchn last edited by

          Oh, sorry.
          Yes, Windows and VisualStudio 2013 Compiler

          JonB 1 Reply Last reply Reply Quote 0
          • JonB
            JonB @JoSchn last edited by JonB

            @JoSchn
            Then I would look into the memory analysis tools which I believe are supplied with VS 2013.

            You could try a valgrind substitute like e.g. Valgrind for Windows (which is Deleaker), which says it works for VS, but whether for VS 2013 I don't know. My first thought would be to try whatever MS supply in VS 2013 for this.

            1 Reply Last reply Reply Quote 0
            • cristian-adam
              cristian-adam last edited by

              Have a look at Qt Creator's Detecting Memory Leaks with Heob.

              JonB 1 Reply Last reply Reply Quote 1
              • JonB
                JonB @cristian-adam last edited by

                @cristian-adam
                Hi. That github repo only mentions MinGW and MSVC. Neither it nor the Qt docs page say anything about platforms. Is it Linux too?

                1 Reply Last reply Reply Quote 0
                • cristian-adam
                  cristian-adam last edited by

                  It looks like a Windows only solution, which is fine since Valgrind is available for Unix.

                  JonB 1 Reply Last reply Reply Quote 0
                  • JonB
                    JonB @cristian-adam last edited by

                    @cristian-adam
                    Sure, i was just asking because I am a Linux Qt user and had not heard of it! :) Fine for the OP here!

                    1 Reply Last reply Reply Quote 0
                    • Chris Kawa
                      Chris Kawa Moderators last edited by

                      MTuner and Visual Leak Detector are both excellent tools that helped me in the past with leak detection.
                      Also, if you can run your app under the debugger Visual Studio has a built in memory profiler. You can take snapshots of your process memory before and after some period of time and see allocations with callstacks made in between. I don't think it was available in VS2013, but you can use a never version of the IDE only for debugging.

                      1 Reply Last reply Reply Quote 2
                      • cristian-adam
                        cristian-adam last edited by

                        Besides Heob you can use Find memory leaks with the CRT library which is specific to MSVC, and the cross platform version at A Cross-Platform Memory Leak Detector.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post