My application is a tabbed application with an instance of the desktop WinformsMap control on each tab. When a tab is disposed, I would expect the memory that was allocated the Map to be returned, but it is not. It just piles up in the Gen 2 heap. As tabs are opened and closed the accumulated allocations eventually cause problems.
To illustrate the issue I made a simple VS2010 project. I has 'Add Tab' and 'Remove Tab' menu selections. With those you can create a collection of tabs, each with a WinformsMap object preloaded with a 1.5meg PNG image, and then remove them.
Run Resource Monitor (or your favorite profiler) and watch the memory allocs as you add tabs. Then watch the allocs remain as you remove tabs. I have let this run for 8 hours and the garbage collector never de-allocs the memory (like I said, stuck in Gen 2 heap).
It looks like the WinformsMap is not releasing its unmanged resources correctly. Am I correct?
Dave
(I tried to attach the project, but it is limited to only 500kb... I will send it in email if you will tell me where to send it)