|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
hosting controls in IE, best practice for disposing of memory?I'm currently looking into an issue I've noticed with the .Net framework and hosting controls in IE. We have a webpage which has 2 frames, the topbar frame hosts a .Net control that acts as a client and talks to a server. The bottom frame hosts various java views and some ..Net views to display the information in the client control. I noticed whilst debugging that when the page is moved from one view(control) to another the old one is still running in memory, in the background, I saw this by some debug traces that were still in the code. it appears that when the page changes it doesn't actually dispose of the controls but just disposes of their Handles. Thus all arrays of data etc stored in them sit there gobbling memory. Take for instance, initially IExplore process before a "view" is loaded consumes approx 40mb with the topbar .Net client loaded... I then load up one of my biggest controls/views and this jumps to around 85mb, I then switch to a java view, which is another webpage, and it drops to about 83mb... hardly any memory recovered what so ever... Once I realised this was happening I overrode OnHandleDestroyed and cleared out my arrays, and regained a lot of the memory, down from 85mb to about 60mb... So my question is, is there some documentation somewhere about this? Best practise for disposing of .Net controls hosted in IE, as they consume memory when really they should be disposed and the garbage collector (or whatever it's called in .Net) be regaining almost all the memory. Thanks, Kris Wragg |
|||||||||||||||||||||||