GC notification event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul F. Williams

    #1

    GC notification event

    Is there a way to determine when the system has performed a garbage
    collection? I would like to be able to write a console message when the CLR
    performs a GC. Knowing when a GC happens might help me debug some odd
    problems.


  • Chris Lyon [MSFT]

    #2
    RE: GC notification event

    Hi Paul

    Currently there is no notification sent when a GC occurs. One possible solution would be to put a console.writeli ne in an object's finalizer, since that will only get called when a
    collection occurs. The catch, however, is that the CLR makes no guarantees as to when a finalizer gets called (if it gets called at all ).

    -Chris


    --------------------[color=blue]
    >From: "Paul F. Williams" <someone@who.do es.not.like.spa m>
    >Subject: GC notification event
    >Date: Mon, 6 Oct 2003 16:34:14 -0500
    >Lines: 6
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <OiZYcGFjDHA.32 12@tk2msftngp13 .phx.gbl>
    >Newsgroups: microsoft.publi c.dotnet.genera l
    >NNTP-Posting-Host: 204-62-8-212.intervoice-brite.com 204.62.8.212
    >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
    >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:110951
    >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
    >
    >Is there a way to determine when the system has performed a garbage
    >collection? I would like to be able to write a console message when the CLR
    >performs a GC. Knowing when a GC happens might help me debug some odd
    >problems.
    >
    >
    >[/color]


    --

    This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm

    Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.

    Comment

    Working...