Click here to Skip to main content
15,886,678 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to get Drive label (Volume Label) Pin
Vimalsoft(Pty) Ltd16-May-07 20:53
professionalVimalsoft(Pty) Ltd16-May-07 20:53 
GeneralRe: How to get Drive label (Volume Label) Pin
Zaegra16-May-07 21:48
Zaegra16-May-07 21:48 
QuestionHow to get Drive Label (volume label) Pin
Zaegra16-May-07 20:31
Zaegra16-May-07 20:31 
AnswerRe: How to get Drive Label (volume label) Pin
Dave Kreskowiak17-May-07 4:34
mveDave Kreskowiak17-May-07 4:34 
QuestionGarbage collector Pin
Sonia Gupta16-May-07 19:53
Sonia Gupta16-May-07 19:53 
AnswerRe: Garbage collector Pin
Christian Graus16-May-07 20:55
protectorChristian Graus16-May-07 20:55 
GeneralRe: Garbage collector Pin
Dave Kreskowiak17-May-07 4:37
mveDave Kreskowiak17-May-07 4:37 
AnswerRe: Garbage collector Pin
Dave Kreskowiak17-May-07 4:29
mveDave Kreskowiak17-May-07 4:29 
Nilish wrote:
even this is not realeasing the class2 object memory.
Why is this happening?


This depends on where you're getting your memory information from. If it's Task Manager, you're making the typical newbie mistake.

Managed Code (.NET CLR) applications run in a virtual machine, just like Java does. The application makes memory allocations and gets them filled by the CLR Memory Manager, which maintains a Managed Heap. This heap is reserved by the CLR, even though your application isn't using the entire heap, it's still allocated to a process as far as Windows, and Task Manager, is concerned.

When your code allocates on object, the request goes to the CLR Memory Manager. If there is sufficient free memory in the Managed Heap, the object is allocated out of that Heap. If not, the Memory Managed requests a block of memory from Windows and adds it to the Heap, THEN allocated your object out of the newly expanded Managed Heap.

If Windows wants some memory back, it just tells the CLR Memory Managed and it'll free up whatever it can that isn't being used.

This is what you're seeing in Task Manager. You're not seeing the actual memory your application is using. You're seeing what the CLR has reserved for your application.

If you want to see the actual memory use, you'll have to use Performance Monitor and the .NET CLR memory counters to the real numbers.




A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


Questionsource code to convert wav File to MP3 File in vb.net. Pin
Fujiwara Gili16-May-07 19:38
Fujiwara Gili16-May-07 19:38 
AnswerRe: source code to convert wav File to MP3 File in vb.net. Pin
Sonia Gupta16-May-07 21:30
Sonia Gupta16-May-07 21:30 
QuestionModal Dialog That will lock system Pin
Polymorpher16-May-07 19:35
Polymorpher16-May-07 19:35 
AnswerRe: Modal Dialog That will lock system Pin
Sonia Gupta16-May-07 21:56
Sonia Gupta16-May-07 21:56 
GeneralRe: Modal Dialog That will lock system Pin
Polymorpher17-May-07 8:48
Polymorpher17-May-07 8:48 
QuestionCreate a User Defined Control in VB Pin
Xandip16-May-07 19:19
Xandip16-May-07 19:19 
AnswerRe: Create a User Defined Control in VB Pin
Christian Graus16-May-07 19:32
protectorChristian Graus16-May-07 19:32 
GeneralRe: Create a User Defined Control in VB Pin
Xandip16-May-07 19:48
Xandip16-May-07 19:48 
GeneralRe: Create a User Defined Control in VB Pin
Christian Graus16-May-07 20:56
protectorChristian Graus16-May-07 20:56 
AnswerRe: Create a User Defined Control in VB Pin
Sonia Gupta16-May-07 19:58
Sonia Gupta16-May-07 19:58 
Question1 Computer to another computer Pin
Socheat.Net16-May-07 18:57
Socheat.Net16-May-07 18:57 
AnswerRe: 1 Computer to another computer Pin
Christian Graus16-May-07 19:04
protectorChristian Graus16-May-07 19:04 
GeneralRe: 1 Computer to another computer Pin
Socheat.Net16-May-07 21:01
Socheat.Net16-May-07 21:01 
QuestionRe: 1 Computer to another computer Pin
Sonia Gupta16-May-07 23:09
Sonia Gupta16-May-07 23:09 
AnswerRe: 1 Computer to another computer Pin
Socheat.Net16-May-07 23:33
Socheat.Net16-May-07 23:33 
GeneralRe: 1 Computer to another computer Pin
Dave Kreskowiak17-May-07 2:53
mveDave Kreskowiak17-May-07 2:53 
QuestionApplication.Doevents Pin
Sonia Gupta16-May-07 18:35
Sonia Gupta16-May-07 18:35 

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.