PDA

View Full Version : When does Qt release memory and resources?



jimc1200
23rd April 2012, 19:57
Hi!

I've been trying to monitor my application's memory usage and it appears that the memory is not immediately released by Qt when destroying/releasing objects such
as list view items. I have a list view with hundreds of item widgets in it and I can see the memory increase as new items are created and added into the list. However, as I destroy the widget items, I can't see the memory footprint decrease. Does Qt release the resources at a later time? If so, is there documentation that states this kind of memory management?
Thanks in advance for any help.

regards,
jim

zgulser
23rd April 2012, 20:04
Hi,

Actually it should immediately release the sources. I mean it doesn't take that much time that causes you couldn't see it in your monitoring program.

But I think you couldn't properly delete the items inside for some reason. Can you post a piece of code?

wysota
24th April 2012, 00:09
I've been trying to monitor my application's memory usage and it appears that the memory is not immediately released by Qt
Memory management is handled by the programming language you are using and its runtime environment. I might ask you how you see "the memory increase" but I'm expecting a reply such as "I can see that in the task manager" or "I can see that in top", so I'll tell you right away those are not a reliable way of measuring memory usage. If you want to know how memory allocation in your operating system works, consult its manual and other technical documents on it. Qt really has nothing to do with that.