whoami
whoami

Reputation: 1899

understanding application memory usage

My application is showing following values for different performance counters.

enter image description here

I have two questions.

  1. I thought # of Bytes in all Heaps represents .net memory usage in all heaps. If that's correct, that should be equal to heap sizes of Gen 0, 1, 2 and large object heap which is not the case here.

  2. Reserve bytes represents the available memory that .net uses to fulfil next allocation requirements. In that case shouldn't reserved bytes always be greater than committed bytes which is not the case here.

Can someone please explain what am I misunderstanding here?

Upvotes: 2

Views: 955

Answers (1)

ForguesR
ForguesR

Reputation: 3618

Question 1

According to Microsoft documentation:

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

So the #Bytes in all Heaps is equal to Gen 1 heap size, Gen 2 heap size and Large Object heap size. You can do the math.

Question 2

Again quoting Microsoft documentation :

Virtual memory can be in three states:

  • Free. The block of memory has no references to it and is available for allocation.

  • Reserved. The block of memory is available for your use and cannot be used for any other allocation request. However, you cannot store data to this memory block until it is committed.

  • Committed. The block of memory is assigned to physical storage.

So # Total committed Bytes is the total amount of memory currently used and # Total reserved Bytes is the memory reserved that is not yet commited (stored physically).

The way I understand this is that reserved bytes are ready for you but physical storage is not yet ready to receive your data.

Upvotes: 1

Related Questions