Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Memory leaks in TreeView ?
Forum Updated to NodeBB v4.3 + New Features

Memory leaks in TreeView ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 2 Posters 1.6k 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
    Citron
    wrote on last edited by
    #1

    Hi there,

    I was investigating a constant memory growth in a QML application of mine, and I created a really simple QML application that uses a TreeView and a FolderListModel. I use a timer to repeatedly switch the folder of the model between 2 folders, and the memory used by the application keeps growing.

    Here is the application that I tested. You can save to a file and run directly through qmlscene :

    import QtQuick 2.3
    import QtQuick.Controls 1.4
    import QtQuick.Window 2.2
    import Qt.labs.folderlistmodel 2.1
    
    Window {
    	id: root
    
    	visible: true
    
    	width: 500
    	height: 500
    
    	Timer {
    		id: timer
    		interval: 0
    		onTriggered: {
    			fileSystemModel.folder = fileSystemModel.odd ? "file:///D:/" : "file:///C:/";
    			fileSystemModel.odd = !fileSystemModel.odd;
    			timer.start();
    		}
    	}
    
    	Component.onCompleted: {
    		timer.start();
    	}
    
    	FolderListModel {
    		id: fileSystemModel
    		property bool odd: false
    	}
    
    	TreeView {
    		anchors.fill: parent
    		TableViewColumn {
    			title: "Name"
    			role: "fileName"
    			width: 300
    		}
    		model: fileSystemModel
    	}
    
    }
    

    And here is a screenshot of the process explorer for qmlscene :

    TreeView leaks ?

    I would be interested if someone could run this little application on other platforms and tell me if they notice this behavior.
    Also, if this is a known leak, or if I do something that I shouldn't, I would be interested in a solution.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I'd recommend bringing that topic to the interest mailing list. You'll find there Qt's developers/maintainers (this forum is more user oriented)

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Citron
        wrote on last edited by
        #3

        Hi,

        Thanks for the suggestion. I'm really not familiar with mailing lists (and a bit afraid of the quantity of emails I would receive if I was to subscribe to one such as Qt) Is there no other place where developers go ?
        Or do you think that I should report an issue ?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You can modify your subscription and only get one digest, otherwise there's also the #qt IRC channel

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Citron
            wrote on last edited by
            #5

            Hi again !

            I finally registered to the mailing list in digests mode and sent my question there. I hope it will have a little more success than here :)
            Thanks !

            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