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

QtCreator does not release memory when closing documents

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • Qt Creator 4.0.0
    • C/C++/Obj-C++ Support
    • None
    • Kubuntu 16.04, x86_64, CMake 3.5.1, Clang code model.

    Description

      The main QtCreator process does not release memory when closing no longer used documents. This results in significant memory consumption growth over time (in my case it can easily reach 1-2 GB by the end of a day of coding).

      I performed a simple test with my project (C++11, Boost, CMake):

      1. Start QtCreator and open the project. Only one small file is open in the editor from the previous session. qtcreator: 356MB, clangbackend: 37MB.
      2. Perform a search for a relatively frequent word in the source tree. My search result: 88 matches, 42 files.
      3. Open every file in the search results. After opening each file, wait for the parsing to complete and code coloring to appear. When all files are open: qtcreator: 695MB, clangbackend: 5021MB.
      4. Close all files but the initial one. qtcreator: 695MB, clangbackend: 236MB.
      5. Pick and open several other files that were not in the search results. qtcreator: 709MB, clangbackend: 1008MB.
      6. Close them. qtcreator: 709MB, clangbackend: 170MB.

      I tried to perform the test under valgrind (log attached), but it doesn't look like the majority of this growth is due to a genuine leak, although the report contains a few. So my guess is that some parts of the code model in the qtcreator process are not deleted on closing the document and are destroyed only on closing the application.

      Attachments

        Issue Links

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

          Activity

            People

              kosjar Nikolai Kosjar
              lastique Andrey Semashev
              Votes:
              6 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes