473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

System GC interface or events?

Bob
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!
Jul 21 '05 #1
3 1835
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

--------------------
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$**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: blv-gate-01.boeing.com 130.76.32.64
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:121819
X-Tomcat-NG: microsoft.public.dotnet.general

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!

--

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.

Jul 21 '05 #2
Bob
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]"" <cl***@online.microsoft.com> wrote in message
news:gY**************@cpmsftngxa07.phx.gbl...
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

--------------------
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$**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: blv-gate-01.boeing.com 130.76.32.64
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!tk2msftngp13.
phx.gblXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:121819
X-Tomcat-NG: microsoft.public.dotnet.general

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 inmy 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 happenwhile the application is frozen, if it freezes for longer than 2 seconds.
Thanks!


--

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.

Jul 21 '05 #3
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.public.dotnet.framework.performance newsgroup.

If you have any other questions, let me know

Thanks
-Chris

--------------------
From: "Bob" <rv@b.com>
References: <O$**************@tk2msftngp13.phx.gbl> <gY**************@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**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: blv-gate-01.boeing.com 130.76.32.64
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!cpmsftng xa09.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx .gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:121873
X-Tomcat-NG: microsoft.public.dotnet.general

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]"" <cl***@online.microsoft.com> wrote in message
news:gY**************@cpmsftngxa07.phx.gbl...
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

--------------------
>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$**************@tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.dotnet.general
>NNTP-Posting-Host: blv-gate-01.boeing.com 130.76.32.64
>Path:cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFT NGP08.phx.gbl!tk2msftngp13.
phx.gbl >Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:121819
>X-Tomcat-NG: microsoft.public.dotnet.general
>
>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 knowin >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 nothappen >while the application is frozen, if it freezes for longer than 2 seconds.
>Thanks!
>
>
>

--

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.


--

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.

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ash | last post by:
Hello all, I am hoping this is the appropriate newsgroup for a C++ interface design question. I am trying to design an interface for a subscriber to register/deregister handlers for various...
2
by: Derrick | last post by:
How does one declare an event within an interface, so that every class which implements that interface must implement that event? I think I just need to specifiy the actual event as I would a...
0
by: Dave McIver | last post by:
Hello all, Any help on this issue appreciated because I am getting a bit stuck! I am using VS.NET 2003. I have wrapped a multithreaded win32 dll using managed C++ and added a C# interface,...
2
by: COLIN JACK | last post by:
Hi All, I've got a situation where I'm implementing an interface (BaseInterface in example below) and I want to use explicity interface implementation of an event so that I can add type safety. ...
0
by: Gene | last post by:
I have a Windows Form control that I have embedded in an ASP.NET page. I now have the need to catch an event from the control on the webpage. After researching the situation I found that this is...
0
by: solex | last post by:
Hello All, I have posted previously regarding the above assembly. I have created a 2 classes and an interface to mask the complexities of using the above assembly. The purpose of the interface...
6
by: Ricky W. Hunt | last post by:
It's dawning on my a lot of my problems with VB.NET is I'm still approaching it in the same way I've programmed since the late 70's. I've always been very structured, flow-charted everything, used...
3
by: Bob | last post by:
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...
2
by: puzzlecracker | last post by:
I want interface, that in addition to providing methods declarion, also contain events: interface Connection{ public event MyDelegateHandler handler; public event MyDelegateHandler2...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.