I checked Windows 'Task Manager' (Processes - Memory)
Thanks
I checked Windows 'Task Manager' (Processes - Memory)
Thanks
Ok, so you don't know if the memory has been freed or not, just that the operating system hasn't reduced the memory allocated to the process.
Does the memory increase another 12 MB when you open the dialog again?
Cheers,
_
No, the memory of my application is increased only the first time I open the dialog (and never decreases)
Then I'd say everything is fine, no?
Cheers,
_
The memory is increased when I set a QML file path to my Loader, but I thought the memory used when loaded is freed when setting the loader source to "" (so the memory used by my application decreases), isn't it correct?
Yes, the memory is probably freed (or more accurately, marked as "free" in the memory heap).The memory is increased when I set a QML file path to my Loader, but I thought the memory used when loaded is freed when setting the loader source to ""
No, not necessarily. The memory that has been freed is marked as available, but if other memory that has been allocated from the heap that is still in use, this free memory is probably surrounded by this other memory. Windows will not rearrange the heap when memory is freed, so in this case your program's memory footprint will not decrease.(so the memory used by my application decreases), isn't it correct?
In addition, your program will likely keep some extra memory available on the program's heap so it doesn't have to go back to Windows' memory manager to ask to grow the heap. This allows your program to run faster by avoiding system calls, at the expense of using slightly more memory. 12MB is a tiny amount of memory, actually.
Task Manager is actually a terrible tool to use for monitoring memory usage. It is not granular enough to give accurate readings, and it is not updated frequently enough when a program's memory usage changes rapidly.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
It is. As you found out it is not increased again when you load again, so the memory must have been released before the second loading.
Yes, but since you haven't use any memory measurement tool you are not seeing it.
See d_stranz's post for some reasons why the system might not have reclaimed the freed memory.
Cheers,
_
Bookmarks