Garbage Collection

Discussion in 'ASP .Net' started by Kuldeep, Sep 14, 2007.

  1. Kuldeep

    Kuldeep Guest

    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
    Kuldeep, Sep 14, 2007
    #1
    1. Advertising

  2. Kuldeep

    bruce barker Guest

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

    -- bruce (sqlwork.com)

    Kuldeep wrote:
    > 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
    >
    >
    bruce barker, Sep 14, 2007
    #2
    1. Advertising

  3. Kuldeep wrote:
    > 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öran Andersson
    _____
    http://www.guffa.com
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Sep 14, 2007
    #3
  4. 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.



    "Kuldeep" wrote:

    > 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
    >
    >
    >
    =?Utf-8?B?S3VtYXIuQS5QLlA=?=, Sep 26, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laser Lu

    Garbage Collection and Manage Code?

    Laser Lu, Jan 26, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    700
    Gaurav Khanna [C# MVP]
    Jan 27, 2004
  2. Cheung, Jeffrey Jing-Yen
    Replies:
    3
    Views:
    1,537
    Cheung, Jeffrey Jing-Yen
    Jul 10, 2003
  3. IDoNothing

    Garbage Collection in ASP.NET

    IDoNothing, Jan 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    8,347
    cjohn
    Aug 20, 2009
  4. Replies:
    1
    Views:
    431
    mrstephengross
    Jul 25, 2005
  5. Øyvind Isaksen
    Replies:
    1
    Views:
    948
    Øyvind Isaksen
    May 18, 2007
Loading...

Share This Page