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. Memory is Leaking but Heob don't get it?

Memory is Leaking but Heob don't get it?

Scheduled Pinned Locked Moved Solved General and Desktop
leak detectionheob
6 Posts 4 Posters 656 Views
  • 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.
  • L Offline
    L Offline
    leonardoMB
    wrote on last edited by leonardoMB
    #1

    I'm with the following problem, in my application I have some "widgets", like small windows inside the main application, that contains multiple QWidgets, for example I have a Histogram Widget with a lot of others widgets inside it. This histogram widget has its own custom .dll

    The problem is: If I create one Histogram Widget my RAM gets consumed around 10 MB, and if I close the Histogram I just get 1 MB back , but heob says that from this dll only 65KB "leaked"(I filtered all calls of heob that contains this dll in the stack) .

    The other problem is that if I close this Histogram Widget and open another, I don't use 10 MB, I use like 1MB. I'm just lost and would like some light, thans in advance

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You are checking RAM use with some system tool like System Monitor right?

      Then this is perfectly normal. Such tools report RAM reserved for the application. So, when you open your histogram, 10 MB is requested and granted from the Operating System. When you close (delete) the widget it is properly deallocated but the Operating System will typically keep it "reserved" for the application. So the next time your app requests 0-10MB, the memory is already prepared and can be initialized immediately. The OS manages this reservation automatically and it's not under control of your application. But you can be sure it's not a big 10MB memory leak.

      So, if heob, valgrind or asan do not detect a big leak, there is no big leak. Do not worry about what system monitor shows.

      (Z(:^

      L 1 Reply Last reply
      3
      • sierdzioS sierdzio

        You are checking RAM use with some system tool like System Monitor right?

        Then this is perfectly normal. Such tools report RAM reserved for the application. So, when you open your histogram, 10 MB is requested and granted from the Operating System. When you close (delete) the widget it is properly deallocated but the Operating System will typically keep it "reserved" for the application. So the next time your app requests 0-10MB, the memory is already prepared and can be initialized immediately. The OS manages this reservation automatically and it's not under control of your application. But you can be sure it's not a big 10MB memory leak.

        So, if heob, valgrind or asan do not detect a big leak, there is no big leak. Do not worry about what system monitor shows.

        L Offline
        L Offline
        leonardoMB
        wrote on last edited by
        #3

        @sierdzio Great answer, but what if RAM is a limitation for me? like: I really need that 10 MB

        JonBJ sierdzioS S 3 Replies Last reply
        0
        • L leonardoMB

          @sierdzio Great answer, but what if RAM is a limitation for me? like: I really need that 10 MB

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @leonardoMB What exactly would you like @sierdzio to do about this?

          1 Reply Last reply
          0
          • L leonardoMB

            @sierdzio Great answer, but what if RAM is a limitation for me? like: I really need that 10 MB

            sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            @leonardoMB said in Memory is Leaking but Heob don't get it?:

            @sierdzio Great answer, but what if RAM is a limitation for me? like: I really need that 10 MB

            Your OS should give this memory to other processes if necessary and if your process does not use it for some time. Systems are clever about this :-)

            (Z(:^

            1 Reply Last reply
            1
            • L leonardoMB

              @sierdzio Great answer, but what if RAM is a limitation for me? like: I really need that 10 MB

              S Offline
              S Offline
              SimonSchroeder
              wrote on last edited by
              #6

              @leonardoMB said in Memory is Leaking but Heob don't get it?:

              Great answer, but what if RAM is a limitation for me? like: I really need that 10 MB

              If this is really your problem, then you need to provide more information. More specifically we need your platform and operating system (my guess is embedded with a Linux system?). However, you might get better answers for these kind of problems on Stack Overflow as this is not really related to Qt anymore.

              1 Reply Last reply
              1

              • Login

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