PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms memory not being released

Reply

memory not being released

 
Thread Tools Rate Thread
Old 20-07-2007, 05:01 PM   #1
gigel
Guest
 
Posts: n/a
Default memory not being released


Hello all,

I have a winforms app running on framework v2.0.50727 which isn't not
releasing memory back to the OS after closing forms. Simple forms (a list +
button)
or complex ones (tabs, lots of text boxes, third party masked edit control)
behave the same way,
Every time is instantiated it allocates memory which never gets released.

The code sequence is
Dim frCustomer As New frmCustomer
...
custom code to populate form
....
frCustomer.ShowDialog()
frCustomer.Dispose()
If Not frCustomerIs Nothing Then frCustomer= Nothing

Where should I start troubleshooting? What am I doing wrong.

Thanks a million,

Gigel


  Reply With Quote
Old 20-07-2007, 07:14 PM   #2
AlexS
Guest
 
Posts: n/a
Default Re: memory not being released

Use profiler - see
http://www.microsoft.com/downloads/...&displaylang=en

You can find out if memory is really staying allocated and why


"gigel" <gigel@chidu.net> wrote in message
news:eE1x9cuyHHA.1072@TK2MSFTNGP04.phx.gbl...
> Hello all,
>
> I have a winforms app running on framework v2.0.50727 which isn't not
> releasing memory back to the OS after closing forms. Simple forms (a list
> + button)
> or complex ones (tabs, lots of text boxes, third party masked edit
> control) behave the same way,
> Every time is instantiated it allocates memory which never gets released.
>
> The code sequence is
> Dim frCustomer As New frmCustomer
> ..
> custom code to populate form
> ...
> frCustomer.ShowDialog()
> frCustomer.Dispose()
> If Not frCustomerIs Nothing Then frCustomer= Nothing
>
> Where should I start troubleshooting? What am I doing wrong.
>
> Thanks a million,
>
> Gigel
>



  Reply With Quote
Old 23-07-2007, 03:39 PM   #3
news.microsoft.com
Guest
 
Posts: n/a
Default Re: memory not being released

You might be missing disposing of components in your form. Check if you dont
have below code then add that to you form

protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

________________________
sa@openwinforms.com
http://www.openwinforms.com/
OpenWinForms - open source windows forms and controls
Google group - http://groups.google.com/group/open-winforms


"gigel" <gigel@chidu.net> wrote in message
news:eE1x9cuyHHA.1072@TK2MSFTNGP04.phx.gbl...
> Hello all,
>
> I have a winforms app running on framework v2.0.50727 which isn't not
> releasing memory back to the OS after closing forms. Simple forms (a list
> + button)
> or complex ones (tabs, lots of text boxes, third party masked edit
> control) behave the same way,
> Every time is instantiated it allocates memory which never gets released.
>
> The code sequence is
> Dim frCustomer As New frmCustomer
> ..
> custom code to populate form
> ...
> frCustomer.ShowDialog()
> frCustomer.Dispose()
> If Not frCustomerIs Nothing Then frCustomer= Nothing
>
> Where should I start troubleshooting? What am I doing wrong.
>
> Thanks a million,
>
> Gigel
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off