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. In the window task manager, why can QT program see the memory consumption increase when opening a new widget, but after the widget is closed and the pointer is deleted, the memory consumption does not decrease
Forum Updated to NodeBB v4.3 + New Features

In the window task manager, why can QT program see the memory consumption increase when opening a new widget, but after the widget is closed and the pointer is deleted, the memory consumption does not decrease

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 267 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.
  • C Offline
    C Offline
    canid
    wrote on last edited by
    #1

    In the window task manager, why can QT program see the memory consumption increase when opening a new widget, but after the widget is closed and the pointer is deleted, the memory consumption does not decrease

    aha_1980A JonBJ 2 Replies Last reply
    0
    • C canid

      In the window task manager, why can QT program see the memory consumption increase when opening a new widget, but after the widget is closed and the pointer is deleted, the memory consumption does not decrease

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @canid please show your code.

      And please, aim for shorter topic summaries. the full description can be done in the topic text.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      2
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        The task manager is no tool to look for memory leaks since it does not show when memory is freed up but only when the OS gives memory back. Use a proper tool for this.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        5
        • C canid

          In the window task manager, why can QT program see the memory consumption increase when opening a new widget, but after the widget is closed and the pointer is deleted, the memory consumption does not decrease

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

          @canid
          Apart from @Christian-Ehrlicher's observation about tool for detecting memory consumption.
          I was looking at this recently. What exactly do you mean by "the pointer is deleted"? If you use the usual deleteLater(), memory does not freed until execution returns to the top-level Qt event loop, not before. Or, are you using delete? Even then I wouldn't rely on it being returned to the OS for a one-off. Have you tested this against creating hundreds/thousands of instances of the widget?

          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