Distribution of managed & unmanged memory
-
Wednesday, October 21, 2009 5:03 PMI have a WPF application that shows around 700MB memory in private bytes (perfmon counters). When I check the "# Bytes in all heaps" (total managed memory) it comes to around 200MB. That means around 500MB is unmanaged memory. Is this normal for a typical WPF application? Is there anything that needs to be investigated to see if something is wrong?
All Replies
-
Tuesday, October 27, 2009 1:27 AMHi GovindKaveri,
It is not normal that have 500M unmanaged memory in a WPF application. Please go through your application, and see if some unmanged resources, like file, database connection, are not realeased properly.
Best regards,
Bruce Zhou
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. -
Tuesday, October 27, 2009 9:08 AMHi Bruce,
Thanks for the reply. I am not suspecting files. However, we might keep the database connection ON. Do you suspect that to cause such a high memory usage?
If there are any other possible resources you are suspecting, let me know.
Regards
-Govind -
Tuesday, October 27, 2009 9:37 AMHi Govind,
I don't have a good knowledge of your application, so I can't guess more.
However, I think to get to know whether there is a leak in your application, we need to investigate instead of guessing. Although I know that having some possible ideas in mind can help us analyze and locate the problem quickly.
Here is an article describing how to detect the memory leak, hope it helps.
Best regards,
Bruce Zhou
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. -
Tuesday, October 27, 2009 12:04 PMHi Bruce,
We have been regularly testing the application for the memory leaks. The application has insignificant amount of memory leaks (private bytes increase by ~20MB over 40 hours of continuous operation). Most of the memory increases is observed in Gen2 & hence in Private bytes.
Let's come back to the main issue I am facing. It is about the high memory footprint. On analysis, I have observed that unmanaged portion is consuming significantly large proportion of the memory. I am not able to justify this high unmanaged memory.
Let me talk about the application a little bit. The application is an image viewing & image processing application. Except for the raw data of the image, most of the data is held using the managed objects. The UI is pretty jazzy & uses gradients, bitmap effects, etc. Moreover, after we faced problems in releasing the WPF objects, we are keeping WPF pages (application uses pages in the frames) in memory. We show / hide the pages.
I understand that this will increase overall memory consumption as well as managed memory consumption. But increase in unmanaged memory is still a mystery
Regards,
-Govind

