Click here to Skip to main content
15,908,166 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionWindows Form with TableLayoutPanel is changing its Controls position when is shown in mdiParent Form. How to Resolve this Issue? Pin
Nouman_gcu21-Dec-09 1:20
Nouman_gcu21-Dec-09 1:20 
QuestionWindows Forms Memory Usage... Pin
1.21 Gigawatts20-Dec-09 5:05
1.21 Gigawatts20-Dec-09 5:05 
AnswerRe: Windows Forms Memory Usage... Pin
Luc Pattyn20-Dec-09 5:10
sitebuilderLuc Pattyn20-Dec-09 5:10 
GeneralRe: Windows Forms Memory Usage... Pin
1.21 Gigawatts20-Dec-09 5:11
1.21 Gigawatts20-Dec-09 5:11 
GeneralRe: Windows Forms Memory Usage... Pin
Luc Pattyn20-Dec-09 5:28
sitebuilderLuc Pattyn20-Dec-09 5:28 
GeneralRe: Windows Forms Memory Usage... Pin
1.21 Gigawatts20-Dec-09 5:48
1.21 Gigawatts20-Dec-09 5:48 
GeneralRe: Windows Forms Memory Usage... Pin
Luc Pattyn20-Dec-09 6:27
sitebuilderLuc Pattyn20-Dec-09 6:27 
AnswerRe: Windows Forms Memory Usage... Pin
Dave Kreskowiak20-Dec-09 7:57
mveDave Kreskowiak20-Dec-09 7:57 
1.21 Gigawatts wrote:
when looking at the memory usage in the Windows Task Manager


Big mistake. Task Manager show you how much memory the .NET CLR has reserved for you application, not how much it's actually using. Think of the .NET CLR as a virtual machine, a kin to Java. You're seeing the memory that is allocated for the vm, not for what's running inside it.

The .NET CLR maintains a managed memory heap. This is memory that is allocated by Windows and handed to the .NET CLR. The CLR take that memory and allocates everything out of this heap. When your app is done using an object (it goes out of scope), that memory is returned to the managed heap, NOT to Windows. So, according to Task Manager, your app will be "using" 20-30MB of RAM, when it's really only using 10.

Instead of using Task Manager, use Performance Monitor (Start/Run -> Perfmon.msc). You'll find all kind of .NET memory counters you can use to see what your app is really using.



1.21 Gigawatts wrote:
I know that you can't determine when garbage collection is done, but I thought that was the purpose of the GC.Collect() method.


No, it doesn't. GC.Collect only suggests that the Garbage Collector be run. It's really a bad idea to do this, unless you really understand why your doing it, how the GC works, and understand the side-effects of running it.

The GC is self-tuning. It watches how your app allocates and frees memory and tunes itself so it doesn't interfere with your app and can keep memory (free and used) organized with future performance in mind, such as allocating future object faster.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




GeneralRe: Windows Forms Memory Usage... Pin
1.21 Gigawatts20-Dec-09 19:46
1.21 Gigawatts20-Dec-09 19:46 
GeneralRe: Windows Forms Memory Usage... Pin
Roger Wright21-Dec-09 20:29
professionalRoger Wright21-Dec-09 20:29 
QuestionDatagridview inside a datagridview combobox control. Pin
arj_agt17-Dec-09 2:10
arj_agt17-Dec-09 2:10 
AnswerRe: Datagridview inside a datagridview combobox control. Pin
Mycroft Holmes17-Dec-09 4:01
professionalMycroft Holmes17-Dec-09 4:01 
GeneralRe: Datagridview inside a datagridview combobox control. Pin
arj_agt17-Dec-09 4:34
arj_agt17-Dec-09 4:34 
GeneralRe: Datagridview inside a datagridview combobox control. Pin
Mycroft Holmes17-Dec-09 12:02
professionalMycroft Holmes17-Dec-09 12:02 
GeneralRe: Datagridview inside a datagridview combobox control. Pin
arj_agt17-Dec-09 15:39
arj_agt17-Dec-09 15:39 
GeneralRe: Datagridview inside a datagridview combobox control. Pin
arj_agt24-Dec-09 2:27
arj_agt24-Dec-09 2:27 
QuestionFluid Layout By Custom Polygon Shapes Pin
Som Shekhar15-Dec-09 18:36
Som Shekhar15-Dec-09 18:36 
AnswerRe: Fluid Layout By Custom Polygon Shapes - [REPOST] Pin
Richard MacCutchan15-Dec-09 23:27
mveRichard MacCutchan15-Dec-09 23:27 
GeneralRe: Fluid Layout By Custom Polygon Shapes - [REPOST] Pin
Som Shekhar15-Dec-09 23:28
Som Shekhar15-Dec-09 23:28 
GeneralRe: Fluid Layout By Custom Polygon Shapes - [REPOST] Pin
Som Shekhar15-Dec-09 23:29
Som Shekhar15-Dec-09 23:29 
GeneralRe: Fluid Layout By Custom Polygon Shapes - [REPOST] Pin
Richard MacCutchan15-Dec-09 23:31
mveRichard MacCutchan15-Dec-09 23:31 
GeneralRe: Fluid Layout By Custom Polygon Shapes - [REPOST] Pin
Som Shekhar15-Dec-09 23:33
Som Shekhar15-Dec-09 23:33 
GeneralRe: Fluid Layout By Custom Polygon Shapes - [REPOST] Pin
Richard MacCutchan16-Dec-09 0:14
mveRichard MacCutchan16-Dec-09 0:14 
GeneralRe: Fluid Layout By Custom Polygon Shapes - [REPOST] Pin
Som Shekhar16-Dec-09 0:14
Som Shekhar16-Dec-09 0:14 
GeneralRe: Fluid Layout By Custom Polygon Shapes - [REPOST] Pin
Som Shekhar16-Dec-09 0:18
Som Shekhar16-Dec-09 0:18 

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.