Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does .NET Memory "Gen X Heap Size" .NET performance counters measure exacly?

Is that "the sum of all objects allocated" or is it "amount of memory allocated from the operating system for storing objects". Or is it something else?

I think it is memory allocated from the OS, but would like a confirmation.

like image 619
Arve Avatar asked Feb 24 '10 14:02

Arve


2 Answers

It depends on the Generation number. For Gen 0 it measures the max memory you can allocate:

MSDN quote :

Displays the maximum bytes that can be allocated in generation 0;
it does not indicate the current number of bytes allocated in generation 0.

For Gen 1 & 2 it measures the sum of all allocated objects because in these generations objects are actually promoted not allocated.

Displays the current number of bytes in generation 1;
this counter does not display the maximum size of generation 1.

like image 50
Branislav Abadjimarinov Avatar answered Oct 10 '22 20:10

Branislav Abadjimarinov


Generation heap size measures the total allocated memory of the managed portion of all .NET objects currently in that particular garbage collection generation.

See this for more information.

like image 31
David Morton Avatar answered Oct 10 '22 22:10

David Morton