Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Running Valgrind on a Library to detect Memory Leaks if any
Forum Updated to NodeBB v4.3 + New Features

Running Valgrind on a Library to detect Memory Leaks if any

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.4k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    TheCrowKaka
    wrote on last edited by
    #1

    Hello

    I have a library on which I want to check memory leaks.
    I make a testing program and run the functions from the library, it shows me some issue on the statement where i define the object.
    Now, I want to test on the library to find the exact statements where there might be some leaks.
    I dont know how to do that.

    Can someone help here.

    A Qt Enthusiastic...

    1 Reply Last reply
    0
    • 6thC6 Offline
      6thC6 Offline
      6thC
      wrote on last edited by
      #2

      There are static memory analysis tools that would find some quick wins (probably).

      What environment are you running?

      I use Valgrind in Linux and Clang Static Analyzer in windows.
      I use the online binaries of latest released Qt
      I run with GCC compiler for linux, mingw and VS for windows...

      It's a pretty easy process either way, load of info around. Basically just run it up in the debugger but under static analysis and find the obvious wins!

      1 Reply Last reply
      2
      • T Offline
        T Offline
        TheCrowKaka
        wrote on last edited by
        #3

        For the testing, I am using Ubuntu with Valgrind on Qt5.10.1

        What are the best static tools for Linux?

        A Qt Enthusiastic...

        1 Reply Last reply
        0
        • 6thC6 Offline
          6thC6 Offline
          6thC
          wrote on last edited by
          #4

          I don't know all the tools of course, I've never needed any more than Valgrind and that suite.

          If there's other automated tools or other tools that people find equally invaluable, I wouldn't mind knowing either =) - good tools are good to know about.

          I use this too - https://gres.biz/qtc-cppcheck/ - it catches more easy mistakes / makes like generally pleasant.
          https://github.com/OneMoreGres/qtc-cppcheck/releases

          I get a couple of "The function '' is never used" where they are only called via a signal connection... but all the other warnings and suggestions are really nice.
          That's an Qt Creator plugin that I always put on.

          T 1 Reply Last reply
          2
          • 6thC6 6thC

            I don't know all the tools of course, I've never needed any more than Valgrind and that suite.

            If there's other automated tools or other tools that people find equally invaluable, I wouldn't mind knowing either =) - good tools are good to know about.

            I use this too - https://gres.biz/qtc-cppcheck/ - it catches more easy mistakes / makes like generally pleasant.
            https://github.com/OneMoreGres/qtc-cppcheck/releases

            I get a couple of "The function '' is never used" where they are only called via a signal connection... but all the other warnings and suggestions are really nice.
            That's an Qt Creator plugin that I always put on.

            T Offline
            T Offline
            TheCrowKaka
            wrote on last edited by
            #5

            @6thC
            Thanks for this information. I will download and try to use this static tool.
            But other than static tool, does any one know of a dynamic tool for finding memory leaks from a library?

            A Qt Enthusiastic...

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved