473,388 Members | 1,209 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,388 software developers and data experts.

Finalize times out during shutdown

It seems that if Finalize takes more than 2 seconds during
the process shutdown, the process will just terminate
anyway. How can I specifically tells GC that this guy's
clean up does suppose to take that long so that please
wait until I finish my job gracefully?
Jul 21 '05 #1
2 1593
Jack <an*******@discussions.microsoft.com> wrote:
It seems that if Finalize takes more than 2 seconds during
the process shutdown, the process will just terminate
anyway.
Yes.
How can I specifically tells GC that this guy's
clean up does suppose to take that long so that please
wait until I finish my job gracefully?


I don't know that there's any way of doing that during shutdown - if
you've got something to finish, it would be much better to do it before
you start the shutdown process.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
Hi Jack

No, there's no way to change the Finalizer timeout. This is to avoid an object's finalizer from starving other finalizers, or causing the runtime to hang.

You should consider using the Dispose pattern to free up any resources before shutdown, and then you can take as long as you need to.

Hope that helps
-Chris

--------------------
Content-Class: urn:content-classes:message
From: "Jack" <an*******@discussions.microsoft.com>
Sender: "Jack" <an*******@discussions.microsoft.com>
Subject: Finalize times out during shutdown
Date: Thu, 13 Nov 2003 13:03:32 -0800
Lines: 5
Message-ID: <02****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOqKZh5r68wFS0BTmu7zPcmiKZxyA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:115548
NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
X-Tomcat-NG: microsoft.public.dotnet.general

It seems that if Finalize takes more than 2 seconds during
the process shutdown, the process will just terminate
anyway. How can I specifically tells GC that this guy's
clean up does suppose to take that long so that please
wait until I finish my job gracefully?

--

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

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

Similar topics

8
by: celeong | last post by:
Hi, anybody can help me with this. I've created a singleton class, and now wants to add destructor to it. I know we can implement the IDisposable and also overrides the Finalize method (from...
20
by: Charles Law | last post by:
I have an application that creates a class. The class has unmanaged resources, so must end gracefully. How can I guarantee that the unmanaged resources are freed? I have looked at IDisposable,...
12
by: Joe Abou Jaoude | last post by:
hi, I have a component that uses a database connection. In the finalizer I dispose the connection because I read in msdn the following: "A type must implement Finalize when it uses...
4
by: Jack | last post by:
It seems that if Finalize takes more than 2 seconds during the process shutdown, the process will just terminate anyway. How can I specifically tells GC that this guy's clean up does suppose to...
7
by: SalamElias | last post by:
I started to use the Finalize sub in aspax page, I put a break point on one of the lines, hit run with debug, the pages dispalys without breaking on the line. 2nd question, do we need to use the...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
10
by: ask4rishi | last post by:
Hi , We are monitoring the applications using the verboseGC. And in our application we have large number of finalize method. We have observed through VerboaseGC logs that lots of Finalize objects...
9
by: SAL | last post by:
I have an ASP.NET 2.0 app that takes about 17 seconds to load on first startup but then is very fast after that. As I understand it from some posts in June, this is caused by the loading of the App...
15
by: Barry Flynn | last post by:
VB 2005. I have the following code in a Sub. Dim oFred As SillyClass oFred = New SillyClass oFred.Gloop() oFred = Nothing Exit Sub
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.