System GC interface or events?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob

    #1

    System GC interface or events?

    Is there an interface or events in the system that occurs pre and post
    garbage collection that one of my objects can attach to? I need to know in
    my application when garbage collection is about to take place and when it
    has completed. This is to make sure a system critical event does not happen
    while the application is frozen, if it freezes for longer than 2 seconds.
    Thanks!


  • Chris Lyon [MSFT]

    #2
    RE: System GC interface or events?

    Hi Bob

    No, there are no GC events you can monitor to find out when a GC will occur or has occurred.

    What kind of critical event are you concerned out?


    Thanks
    -Chris

    --------------------[color=blue]
    >From: "Bob" <rv@b.com>
    >Subject: System GC interface or events?
    >Date: Mon, 19 Jan 2004 08:40:18 -0800
    >Lines: 8
    >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: <O$Ugtrq3DHA.25 28@tk2msftngp13 .phx.gbl>
    >Newsgroups: microsoft.publi c.dotnet.genera l
    >NNTP-Posting-Host: blv-gate-01.boeing.com 130.76.32.64
    >Path: cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!TK2 MSFTNGP08.phx.g bl!tk2msftngp13 .phx.gbl
    >Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.genera l:121819
    >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
    >
    >Is there an interface or events in the system that occurs pre and post
    >garbage collection that one of my objects can attach to? I need to know in
    >my application when garbage collection is about to take place and when it
    >has completed. This is to make sure a system critical event does not happen
    >while the application is frozen, if it freezes for longer than 2 seconds.
    >Thanks!
    >
    >
    >[/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

    • Bob

      #3
      Re: System GC interface or events?

      There are some in our group that are afraid that .NET will freeze the
      application for up to 15 seconds doing garbage collection when the system
      must respond within 1 second of a button press. From the analysis I have
      done to date, I don't see that happening. I'm just trying to come up with
      anything that would appease their concerns.

      Thanks!

      ""Chris Lyon [MSFT]"" <clyon@online.m icrosoft.com> wrote in message
      news:gYNmdKt3DH A.2996@cpmsftng xa07.phx.gbl...[color=blue]
      > Hi Bob
      >
      > No, there are no GC events you can monitor to find out when a GC will[/color]
      occur or has occurred.[color=blue]
      >
      > What kind of critical event are you concerned out?
      >
      >
      > Thanks
      > -Chris
      >
      > --------------------[color=green]
      > >From: "Bob" <rv@b.com>
      > >Subject: System GC interface or events?
      > >Date: Mon, 19 Jan 2004 08:40:18 -0800
      > >Lines: 8
      > >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: <O$Ugtrq3DHA.25 28@tk2msftngp13 .phx.gbl>
      > >Newsgroups: microsoft.publi c.dotnet.genera l
      > >NNTP-Posting-Host: blv-gate-01.boeing.com 130.76.32.64
      > >Path:[/color][/color]
      cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!TK2 MSFTNGP08.phx.g bl!tk2msftngp13 .
      phx.gbl[color=blue][color=green]
      > >Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.genera l:121819
      > >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
      > >
      > >Is there an interface or events in the system that occurs pre and post
      > >garbage collection that one of my objects can attach to? I need to know[/color][/color]
      in[color=blue][color=green]
      > >my application when garbage collection is about to take place and when it
      > >has completed. This is to make sure a system critical event does not[/color][/color]
      happen[color=blue][color=green]
      > >while the application is frozen, if it freezes for longer than 2 seconds.
      > >Thanks!
      > >
      > >
      > >[/color]
      >
      >
      > --
      >
      > This posting is provided "AS IS" with no warranties, and confers no[/color]
      rights. Use of included script samples are subject to the terms specified at[color=blue]
      > http://www.microsoft.com/info/cpyright.htm
      >
      > Note: For the benefit of the community-at-large, all responses to this[/color]
      message are best directed to the newsgroup/thread from which they
      originated.[color=blue]
      >[/color]


      Comment

      • Chris Lyon [MSFT]

        #4
        Re: System GC interface or events?

        Hi Bob

        There is no reason to expect a delay like that. There are ways to minimize collection delay times when designing an interactive managed application. For example:

        -avoid using finalizers. Objects in the finalization queue tend to hang around longer and require more overhead when collecting
        -avoid forcing generation 2 collections by calling GC.Collect(). Gen2 collections are expensive performance-wise.
        -if possible, use concurrent GC (on multi-proc machines). This setting allows generation 2 collections to occur while the program is running

        See these articles for more information:
        http://msdn.microsoft.com/library/de...anagedcode.asp
        http://msdn.microsoft.com/library/de...etgcbasics.asp
        http://weblogs.asp.net/ricom/archive.../02/40782.aspx (or any other posts by Rico).

        You might also want to monitor the microsoft.publi c.dotnet.framew ork.performance newsgroup.

        If you have any other questions, let me know

        Thanks
        -Chris



        --------------------[color=blue]
        >From: "Bob" <rv@b.com>
        >References: <O$Ugtrq3DHA.25 28@tk2msftngp13 .phx.gbl> <gYNmdKt3DHA.29 96@cpmsftngxa07 .phx.gbl>
        >Subject: Re: System GC interface or events?
        >Date: Mon, 19 Jan 2004 17:34:28 -0800
        >Lines: 64
        >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: <ef$qNWv3DHA.16 52@TK2MSFTNGP11 .phx.gbl>
        >Newsgroups: microsoft.publi c.dotnet.genera l
        >NNTP-Posting-Host: blv-gate-01.boeing.com 130.76.32.64
        >Path: cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!cpm sftngxa09.phx.g bl!TK2MSFTNGP08 .phx.gbl!TK2MSF TNGP11.phx.gbl
        >Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.genera l:121873
        >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
        >
        >There are some in our group that are afraid that .NET will freeze the
        >application for up to 15 seconds doing garbage collection when the system
        >must respond within 1 second of a button press. From the analysis I have
        >done to date, I don't see that happening. I'm just trying to come up with
        >anything that would appease their concerns.
        >
        >Thanks!
        >
        >""Chris Lyon [MSFT]"" <clyon@online.m icrosoft.com> wrote in message
        >news:gYNmdKt3D HA.2996@cpmsftn gxa07.phx.gbl.. .[color=green]
        >> Hi Bob
        >>
        >> No, there are no GC events you can monitor to find out when a GC will[/color]
        >occur or has occurred.[color=green]
        >>
        >> What kind of critical event are you concerned out?
        >>
        >>
        >> Thanks
        >> -Chris
        >>
        >> --------------------[color=darkred]
        >> >From: "Bob" <rv@b.com>
        >> >Subject: System GC interface or events?
        >> >Date: Mon, 19 Jan 2004 08:40:18 -0800
        >> >Lines: 8
        >> >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: <O$Ugtrq3DHA.25 28@tk2msftngp13 .phx.gbl>
        >> >Newsgroups: microsoft.publi c.dotnet.genera l
        >> >NNTP-Posting-Host: blv-gate-01.boeing.com 130.76.32.64
        >> >Path:[/color][/color]
        >cpmsftngxa07.p hx.gbl!cpmsftng xa06.phx.gbl!TK 2MSFTNGP08.phx. gbl!tk2msftngp1 3.
        >phx.gbl[color=green][color=darkred]
        >> >Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.genera l:121819
        >> >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
        >> >
        >> >Is there an interface or events in the system that occurs pre and post
        >> >garbage collection that one of my objects can attach to? I need to know[/color][/color]
        >in[color=green][color=darkred]
        >> >my application when garbage collection is about to take place and when it
        >> >has completed. This is to make sure a system critical event does not[/color][/color]
        >happen[color=green][color=darkred]
        >> >while the application is frozen, if it freezes for longer than 2 seconds.
        >> >Thanks!
        >> >
        >> >
        >> >[/color]
        >>
        >>
        >> --
        >>
        >> This posting is provided "AS IS" with no warranties, and confers no[/color]
        >rights. Use of included script samples are subject to the terms specified at[color=green]
        >> http://www.microsoft.com/info/cpyright.htm
        >>
        >> Note: For the benefit of the community-at-large, all responses to this[/color]
        >message are best directed to the newsgroup/thread from which they
        >originated.[color=green]
        >>[/color]
        >
        >
        >[/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...