Ratio of PrivateBytes to # Bytes in all heaps

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

Is there a rule-of-thumb for a healthy ratio between these two
counters? I think I have some memory leak problems on the run in my
ASP.NET application but the difference between these counters bothers
me. I'm seeing anywhere from 2 to 3:1 ratio. Right now, for example,
private bytes is 95M and total heap is 45MB. Total heap changes more
frequently than private bytes (finally going _down_ too!) but the trend
is for them to stick together.

Also, I assume the difference between these two counters is unmanaged
memory. Is that released when aspnet_wp.exe recycles? I had some
weirdness this morning where an Antivirus run caused it to restart and
the managed counters reset but private bytes didn't go all the way to
0. I don't know if it was a counter anomoly or not.

Anyway, thanks in advance for the tips!

-Brian
 
the private bytes are released when the asp.net worker process exits. this
happens on an asp.net recycle, but not on an appdomain recycle (what a file
changes triggers). there is no rule of thumb for ratio of private bytes vs
managed heap, it all depends on the application.

your best bet is to run application under load, then pause, run gc serveral
times, and check private bytes. then repeat. if the private bytes is
consistant, then you probably don't have a leak.

you need to monitor your application when its healthy, so you can tell when
its not.

-- bruce (sqlwork.com)
 
Back
Top