It appears that QML is bloating in memory from dynamic object create using Qt.createComponent() and createObject(). I've created a simplified test program that shows this. It is available here: https://github.com/mdomschot/qml_mem

Note: I'm using Qt 5.4.0 on Windows 7 and Ubuntu 14.04. It appears in both environments.

I have 6 panels. They are identical except for a title and are mostly just there to consume memory by filling in with fake data. I provide buttons to switch between any them *and* the ability to go to no panel, essentially a blank screen.

Aside from all code being available to build/run in the git repo linked, here are a few of the main snippets (from main.qml)...
1) This is where panels are placed into the GUI.
Qt Code:
  1. Item {
  2. id: panelArea
  3.  
  4. property var item: undefined
  5. property string source: ""
  6. }
To copy to clipboard, switch view to plain text mode 
2) This is how I create the panels.
Qt Code:
  1. var panelSource = "Panel%1.qml".arg(panel)
  2. var component = Qt.createComponent(Qt.resolvedUrl(panelSource), this)
  3. panelArea.item = component.createObject(panelArea, { })
  4. panelArea.source = panelSource
  5. component.destroy()
To copy to clipboard, switch view to plain text mode 
3) This is how I destroy the panels.
Qt Code:
  1. panelArea.item.destroy()
  2. panelArea.item = undefined
  3. panelArea.source = ""
To copy to clipboard, switch view to plain text mode 

I also provide buttons to call gc(), QQmlEngine::trimComponentCache(), and QQmlEngine::clearComponentCache(). All three seem to have little to no effect.

Below is a chart of my data from a single run on Ubuntu. It shows the memory increase over time as I jump between panels. Each panel is a separate line (1-6) and the state where there is no panel is the '-' line.
mem_chart.jpg

I've tried several variants of dynamically loading/unloading panels, including a Loader object, and all have the memory effect. Am I doing something wrong? Is there a method I can use to clean up memory? I fully expect memory to go up as I load all 6 panels. But after destroying all 6, I imagine there is some way to have QML relinquish memory...