Kushal
Kushal

Reputation: 3168

Launch VB.NET form as a separate process

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

Answers (3)

Emond
Emond

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:

  1. Make sure you have no references to the form in any way.
  2. Call GC.Collect()
  3. See if the memory is still claimed

Do not put the GC.Collect() in the final build; it's just to make sure you are not hunting ghosts.

Upvotes: 0

Nils Magne Lunde
Nils Magne Lunde

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

Jonathan Wood
Jonathan Wood

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

Related Questions