CLR in Perfmon

  • Thread starter Thread starter John Wood
  • Start date Start date
J

John Wood

I noticed that if I monitor .NET CLR Memory, and add '# Bytes in all
Heaps' - I usually get 0.

Is it broken? How do I see how much memory is allocated by a .Net app?

Thanks.
 
Actually I noticed that as well and figured that the counter gets
updated only when there's a collection involved. So that could mean that
your application isn't calling the Garbage Collector or it's not running
for a very long time. Try an application that runs for a while or uses
up some memory, you'll then notice the counter get updated. I wonder why
this is so.. I would expect the counter to show me the number of bytes
in all heaps in spite of a GC.

-Andre
 
Ah, yeah, you're right. It just registers it after a collect.

I was gathering stats on the memory overhead of various classes. For the
test I just inserted GC.Collect(s) everywhere and I got the figures I
needed, thanks.

I suppose there's too much overhead in updating this counter on every
allocation?
 
I suppose there's too much overhead in updating this counter on every
allocation?

If someone's willing to do performance measurement at some cost, I'm
sure a slight over head wouldn't really matter :) Besides, we could
choose to set a low refresh rate depending on how long the application
takes to run.

Just my two cents.

-Andre
 
Back
Top