Garbage Collection

K

Kuldeep

Hi All,

Is there a way to test whether Garbage Collection has been successfully
performed for a ASP.NET application.

Even if there is a tool to check this, please let me know.

Regards,
Kuldeep
 
B

bruce barker

there are standard performance counters for how often GC its called, so
just use perfmon. your code can use GC itself.

-- bruce (sqlwork.com)
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Kuldeep said:
Hi All,

Is there a way to test whether Garbage Collection has been successfully
performed for a ASP.NET application.

Even if there is a tool to check this, please let me know.

Regards,
Kuldeep

Use the GC.CollectionCount(generation) to get the number of garbage
collections performed on a specific generation. The generations range
from 0 to GC.MaxGeneration.
 
G

Guest

use one of these to find out whether it has successfully run:
nGC- to find the number of times the GC has run.
cbWorkingSetMem-The number of bytes of memory, native and managed, in use
after the last garbage collection.
nCompactions-The number of times the garbage collector has compacted the heap.
nInduced-The number of times the application has called the Collect method.

Performance Monitor(perfmon) is a good tool to get the graphical display,
but you got to have perfmon always open to see the change. It would not be
possible it your application doesnt produce the memory stress(creation of
objects occuping space of 256MB or more), untill then GC wont be called.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top