Reputation: 3168
I have VB.NET application in which one of the form has IE control in it, the application starts initially with memory size consumed around 9 MBs, but when IE form is launched, the memory consumed rises to 27 MB, and when that form is closed, the memory reduces merely by 3-4 MBs, so why memory allocated to IEFrame is not de-allocated automatically? is there any work around to solve this issue? if possible, launching the form as a separate process would be helpful.
Upvotes: 0
Views: 746
Reputation: 50672
The still allocated memory might not be an issue at all. If you have sufficient available memory in the computer the .NET Garbage Collector will not run to clean up. Only when you need the memory the GC will kick in.
If you want to make sure it is a leak you could do the following:
Do not put the GC.Collect() in the final build; it's just to make sure you are not hunting ghosts.
Upvotes: 0
Reputation: 1824
If you make sure to dispose the form properly, the garbage collector should free up that memory eventually. Running the IE control in a separate process should not be necessary. However, if you are using IE 7, you might want to read this question about memory leaks.
Upvotes: 2
Reputation: 67195
Why not just put that form in a separate application if this is an issue? There are plenty of ways you can pass whatever data between the two apps.
Upvotes: 1