Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-17467

Project Management seems to leak potentially large amounts of memory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • Qt Creator 4.2.0
    • None
    • ArchLinux, 64 bit

    Description

      Let me demonstrate what I mean.
      First I start up Qt Creator with an empty session. I have top running in a different terminal. The qtcreator process initially looks like this (only the relevant columns are included):

        PID      VIRT      RES      %CPU %MEM     TIME+    COMMAND
      17435  744.4m 113.7m   0.0       0.7       0:00.61   qtcreator 
      

      Now I start a reasonably large project, like Qt Creator itself (I'm switching to that project's session, to be precise):

        PID       VIRT        RES      %CPU %MEM     TIME+    COMMAND
      17435  2759.4m 713.4m     0.0       4.5    0:18.28     qtcreator  
      

      Then I switch back to an empty session. My expectation is that the memory allocated for the project is freed again. However:

        PID       VIRT        RES      %CPU %MEM     TIME+    COMMAND
      17435  2759.4m 713.4m     0.0       4.5     0:18.98    qtcreator   
      

      This looks problematic already. Suspicions are confirmed when switching to the other session again:

        PID        VIRT       RES      %CPU %MEM     TIME+    COMMAND
      17435  3258.4m 1.093g      0.0      7.0       0:39.13   qtcreator 
      

      This is actual resident memory. Repeat the procedure a number of times, and your system will start swapping and become unusable until the OOM killer comes to the rescue.

      Additional observations:
      1) The problem seems to be build-system independent. I originally noticed it with qbs projects. When I failed to find any leaks in qbs, I double-checked with qmake, and the same thing happened. Above numbers come from opening qtcreator.pro.
      2) Some quick tests with commenting out some calls seem to indicate that neither the C/C++ nor the QML/JS code model are to blame.
      3) valgrind does not report any memory leaks that could explain above numbers. I conclude from this that the resources are cleaned up on exit, just not during normal operations.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              hunger Tobias Hunger
              kandeler Christian Kandeler
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes