Click here to Skip to main content
15,908,843 members
Home / Discussions / C#
   

C#

 
Generalproblem with c# (help required) Pin
Anonymous21-Sep-04 7:30
Anonymous21-Sep-04 7:30 
GeneralRe: problem with c# (help required) Pin
tdciDoug21-Sep-04 10:39
tdciDoug21-Sep-04 10:39 
GeneralRe: problem with c# (help required) Pin
Christian Graus21-Sep-04 10:44
protectorChristian Graus21-Sep-04 10:44 
GeneralHelp with books Pin
krisst_k21-Sep-04 7:21
krisst_k21-Sep-04 7:21 
GeneralRe: Help with books Pin
Werdna22-Sep-04 6:18
Werdna22-Sep-04 6:18 
GeneralC# Downloader Pin
shiraztk21-Sep-04 7:11
shiraztk21-Sep-04 7:11 
GeneralRe: C# Downloader Pin
Dave Kreskowiak21-Sep-04 8:34
mveDave Kreskowiak21-Sep-04 8:34 
GeneralRe: C# Downloader Pin
Alex Korchemniy21-Sep-04 10:24
Alex Korchemniy21-Sep-04 10:24 
GeneralRe: C# Downloader Pin
Heath Stewart21-Sep-04 11:16
protectorHeath Stewart21-Sep-04 11:16 
GeneralRe: C# Downloader Pin
shiraztk21-Sep-04 18:03
shiraztk21-Sep-04 18:03 
GeneralRe: C# Downloader Pin
Heath Stewart22-Sep-04 6:46
protectorHeath Stewart22-Sep-04 6:46 
GeneralDatabase access freezing main application Pin
Jon G21-Sep-04 6:02
Jon G21-Sep-04 6:02 
GeneralRe: Database access freezing main application Pin
Nick Parker21-Sep-04 6:56
protectorNick Parker21-Sep-04 6:56 
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 
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 
Almost any time you override a method you must call it's base implementation. This is especially true in the case of overriding Dispose(bool), inheritted from Component. If you don't, the class members you don't free that either Component, Control, or any other derivatives know about won't be freed.

Again, though, you do not need to explicitly dispose Components or its derivatives. They are designed so that you don't have to and it is recommend that you don't.

And of course all controls implement IDisposable - they inherit it from Component.

Why does memory drop when you minimize the application? If you read some of the links I gave you, you'd see that the GC runs when the application is idle or when memory is required and objects are available for GC'ing. When you minimize an application, it is considered idle because it does not receive user input (it may still be doing work, but only in the background).

As I hinted at before, you can call GC.Collect but this is highly not recommended because it can cause serious performance problems for your application. The fundamental problem here is your current design: either too many controls or you're not freeing everything you think you're freeing (and because you override Dispose(bool) you're not responsible for freeing everything, especially if you're not calling base.Dispose(bool) in your override).

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles]
GeneralRemoving the cross from a form Pin
exhaulted21-Sep-04 4:16
exhaulted21-Sep-04 4:16 

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.