Click here to Skip to main content
15,907,396 members
Home / Discussions / C#
   

C#

 
QuestionSerial port power Pin
hacker0134-Aug-06 4:18
hacker0134-Aug-06 4:18 
AnswerRe: Serial port power Pin
Stefan Troschuetz4-Aug-06 4:43
Stefan Troschuetz4-Aug-06 4:43 
AnswerRe: Serial port power Pin
stancrm4-Aug-06 6:15
stancrm4-Aug-06 6:15 
AnswerRe: Serial port power Pin
eggie55-Aug-06 20:53
eggie55-Aug-06 20:53 
Questionhow does dispose method actually work? Pin
edel_ong4-Aug-06 4:11
edel_ong4-Aug-06 4:11 
AnswerRe: how does dispose method actually work? Pin
WillemM4-Aug-06 4:16
WillemM4-Aug-06 4:16 
GeneralRe: how does dispose method actually work? Pin
Judah Gabriel Himango4-Aug-06 5:05
sponsorJudah Gabriel Himango4-Aug-06 5:05 
AnswerRe: how does dispose method actually work? Pin
Dave Kreskowiak4-Aug-06 5:00
mveDave Kreskowiak4-Aug-06 5:00 
I bet you're looking at Task Manager for this.

You're assuming that the numbers you see in Task Manager is how much memory your app is using. You're not.

The simplified version of what's happening...

What you are seeing is how much memory the Common Language Runtime that your app is running in (a virtual machine, just like any Java app) is using. This includes memory reserved for future allocations but not yet used by, or just freed by, your app. This is known as the Managed Heap. Memory requested by your application is allocated in the Managed Heap, and when freed by your app, is returned to the Managed Heap, not Windows.

The CLR maintains the Managed Heap and, using a self-tuning process, adjusts its size based on what your application has done in the past. If the CLR suspects your app will make large allocations in the near future, it'll maintain a larger Managed Heap, requesting more memory from Windows to do so. If it feels that it doesn't need as much memory in reserve, it'll release some of the Managed Heap memory back to Windows. Or, if Windows wants it back, it'll free up what it can and let Windows have whatever memory the CLR can free up from the Managed Heap.

SO, what you're seeing in Task Manager is not how much memory your application is using, but is how much memory the CLR Virtual Machine is using and has reserved for your app.


Dave Kreskowiak
Microsoft MVP - Visual Basic


AnswerRe: how does dispose method actually work? Pin
Judah Gabriel Himango4-Aug-06 5:07
sponsorJudah Gabriel Himango4-Aug-06 5:07 
GeneralRe: how does dispose method actually work? Pin
Dan Neely4-Aug-06 5:34
Dan Neely4-Aug-06 5:34 
Question.net remoting concepts Pin
chandut4-Aug-06 3:57
chandut4-Aug-06 3:57 
AnswerRe: .net remoting concepts Pin
Not Active4-Aug-06 4:04
mentorNot Active4-Aug-06 4:04 
GeneralRe: .net remoting concepts Pin
Josh Smith4-Aug-06 7:22
Josh Smith4-Aug-06 7:22 
GeneralRe: .net remoting concepts Pin
Not Active4-Aug-06 8:03
mentorNot Active4-Aug-06 8:03 
GeneralRe: .net remoting concepts Pin
Josh Smith5-Aug-06 9:42
Josh Smith5-Aug-06 9:42 
QuestionBios Date or unchangeable date Pin
Saamir4-Aug-06 3:08
Saamir4-Aug-06 3:08 
AnswerRe: Bios Date or unchangeable date Pin
Robert Rohde4-Aug-06 3:40
Robert Rohde4-Aug-06 3:40 
GeneralRe: Bios Date or unchangeable date Pin
Dan Neely4-Aug-06 3:42
Dan Neely4-Aug-06 3:42 
GeneralRe: Bios Date or unchangeable date Pin
Robert Rohde4-Aug-06 3:54
Robert Rohde4-Aug-06 3:54 
GeneralRe: Bios Date or unchangeable date Pin
Saamir4-Aug-06 5:00
Saamir4-Aug-06 5:00 
QuestionDocumentation tool for c#.net Pin
Madhuri07084-Aug-06 2:39
Madhuri07084-Aug-06 2:39 
AnswerRe: Documentation tool for c#.net Pin
Robert Rohde4-Aug-06 3:02
Robert Rohde4-Aug-06 3:02 
QuestionIs there any global file in c# Pin
Madhuri07084-Aug-06 2:34
Madhuri07084-Aug-06 2:34 
AnswerRe: Is there any global file in c# Pin
Guffa4-Aug-06 2:38
Guffa4-Aug-06 2:38 
AnswerRe: Is there any global file in c# Pin
psamy4-Aug-06 2:44
psamy4-Aug-06 2:44 

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.