ListView memory leak
I have a soft phone application where I am using a ListView to insert out coming or incoming calls. The ListView uses a rather complex delegate with several ToolButtons, RowLayouts and Text components. I am using Qt 5.5 with MSVC 2013 x64 on Win 8.1.
It seems that inserting a new call into the list increases the amount of memory used by the application, but when the call is removed from list the memory is not freed so that the amount of memory consumed by the app grows in time. Only when I exit from the application the memory is freed.
Could someone advise how to solve this issue ?
Even if you properly release allocated resources you still can face memory increase due to memory fragmentation.
Long running application may require about 2 times more memory than you really allocated.
If it grows more you probably do not free resources.
Most of modern systems will still free it when you exit.
But in such case you should look for tools which help you find memory leaks.
I would suggest to check the memory usage, then try to push hundred "calls" to the list, then remove all of them. If memory usage grew and did not get back you probably have memory leak ( and even then I would bet that it is in your code, not Qt)
Thanks for your reply Alex
Actually the issue is related only to the QML frontend, I have decoupled the backend and I am just inserting and removing items from the ListView and the memory is growing, but after some time the memory seems to be freed automatically.
I have tracked down the problem and the memory seems to increase only due to the four ToolButtons when I assign images to them. If only text is displayed there is no memory consumption.
Could this be considered a bug ?