Click here to Skip to main content
15,897,704 members
Home / Discussions / C#
   

C#

 
GeneralRe: Database access freezing main application Pin
Jon G21-Sep-04 7:09
Jon G21-Sep-04 7:09 
GeneralSubscribing multiple forms to a single Resize event Pin
Bisbal21-Sep-04 5:16
sussBisbal21-Sep-04 5:16 
GeneralRe: Subscribing multiple forms to a single Resize event Pin
Heath Stewart21-Sep-04 7:08
protectorHeath Stewart21-Sep-04 7:08 
GeneralRe: Subscribing multiple forms to a single Resize event Pin
Bisbal22-Sep-04 4:46
sussBisbal22-Sep-04 4:46 
GeneralSubscribing multiple forms to a single Resize event Pin
Anonymous21-Sep-04 5:15
Anonymous21-Sep-04 5:15 
GeneralDATAGRID INDEX .There are some mistakes. Please help.Im having a heck of a time Pin
macsgirl21-Sep-04 5:08
macsgirl21-Sep-04 5:08 
QuestionHow to change the color of status bar? Pin
kaalpu21-Sep-04 4:45
kaalpu21-Sep-04 4:45 
GeneralExtreme memory consumption when launching multiple controls in Panel Pin
Magnus Green21-Sep-04 4:20
Magnus Green21-Sep-04 4:20 
My application is using a treeview to interact with the user. Opposite to the treeview i'm using a panel which contains content in the form of UserControls(Which often contain several UserControls). Each time the user chooses something in the treeview the content on the panel is changed. This is done by clearing the contents of the panel and disposing the controls which resides on it.

The panel is cleared using, where MainPanelCRF is the Panel:

private void clearPanel()
{
if(this.MainPanelCRF.Controls.Count > 0)
{
foreach(Control control in this.MainPanelCRF.Controls[0].Controls)
{
if(control != null)
{
control.Dispose();
}
}
this.MainPanelCRF.Controls[0].Dispose();
this.MainPanelCRF.Controls.Clear();
}
}

Even though I dispose the UserControls i'm seeing an increase in memory usage each time I change the UserControl on the panel. The memory increase does not seem to stop either. It easily succeeds 100 000K. Shouldn't the Garbage Collector collect the UserConrols that has been disposed? Is it possible that the UserControls is not disposed properly?

This has been giving me a headache for a couple of days nowMad | :mad: , has anyone got a suggestion as to how I can reduce the memory usage of my application?

Thanks,

Magnus Green
System Developer
Clinsoft AS
Norway
GeneralRe: Extreme memory consumption when launching multiple controls in Panel Pin
Heath Stewart21-Sep-04 7:02
protectorHeath Stewart21-Sep-04 7:02 
GeneralRe: Extreme memory consumption when launching multiple controls in Panel Pin
Magnus Green22-Sep-04 1:36
Magnus Green22-Sep-04 1:36 
GeneralRe: Extreme memory consumption when launching multiple controls in Panel Pin
Heath Stewart22-Sep-04 6:53
protectorHeath Stewart22-Sep-04 6:53 
GeneralRemoving the cross from a form Pin
exhaulted21-Sep-04 4:16
exhaulted21-Sep-04 4:16 
GeneralRe: Removing the cross from a form Pin
Joel Lucsy21-Sep-04 5:37
Joel Lucsy21-Sep-04 5:37 
GeneralRe: Removing the cross from a form Pin
exhaulted21-Sep-04 5:46
exhaulted21-Sep-04 5:46 
GeneralRe: Removing the cross from a form Pin
Joel Lucsy21-Sep-04 5:53
Joel Lucsy21-Sep-04 5:53 
GeneralRe: Removing the cross from a form Pin
exhaulted21-Sep-04 6:27
exhaulted21-Sep-04 6:27 
GeneralRe: Removing the cross from a form Pin
Stefan Troschuetz21-Sep-04 8:16
Stefan Troschuetz21-Sep-04 8:16 
GeneralRe: Removing the cross from a form Pin
exhaulted21-Sep-04 21:44
exhaulted21-Sep-04 21:44 
GeneralRe: Removing the cross from a form Pin
Stefan Troschuetz21-Sep-04 22:02
Stefan Troschuetz21-Sep-04 22:02 
GeneralRe: Removing the cross from a form Pin
exhaulted22-Sep-04 1:40
exhaulted22-Sep-04 1:40 
GeneralRe: Removing the cross from a form Pin
Stefan Troschuetz22-Sep-04 3:40
Stefan Troschuetz22-Sep-04 3:40 
GeneralRe: Removing the cross from a form Pin
exhaulted22-Sep-04 4:06
exhaulted22-Sep-04 4:06 
GeneralRe: Removing the cross from a form Pin
Stefan Troschuetz22-Sep-04 4:35
Stefan Troschuetz22-Sep-04 4:35 
GeneralRe: Removing the cross from a form Pin
exhaulted22-Sep-04 4:48
exhaulted22-Sep-04 4:48 
GeneralRe: Removing the cross from a form Pin
Stefan Troschuetz22-Sep-04 4:59
Stefan Troschuetz22-Sep-04 4:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.