.net Program eats huge amount memory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear Friends
I am doing a vb.net project which consits of 44 Forms and a MDI ParentForm.

I am use Only one COM Control (AxWebBrowser)
And a Third Party(.net control) control (Sandbar)

Main Form is called ParentOfAll.I am load all the forms from this main form..

Consider two forms named form1 and form2 . both of them having a
AxWebBrowserControl. I load frequently this forms and unload from my
MainParentForm..

After unload the forms(For unloading i am use me.close and me.dispose) The
memory used by my Applicatoin doesn't decrease. When I open the form1 or
form2 second,third,.. times the memory still increasing..

The last time My Application touches 148 MB.

After that i load form1 with a html document . The document loads very
slowley (approx 30 seconds to load). But on First time the Browser load s the
document very faster in 3-4 seconds..

How to rectify the Problem
 
Hi,

Well, 148 MB is a lot, are your objects keeping big files in memory? XML
files especially?

also you may have some problems keeping references to objects you dont need
anymore.

Use a memory profiler to see whta is going on.

cheers,
 
Make sure that you are Releasing the COM Object correctly using
Marshal.ReleaseComObject(). See help about this.
 
hi Girish Bharadwaj
Thank you for your comment.

But I having error Marshal.ReleaseComObject() .
I call this fucntion with Marshal.ReleaseComObject(webbrowser) {WebBrowser
is my object name} . It always through the exception InvalidCastcExeption

Can you explain how to do this
Regards
Prakash
 
Back
Top