473,770 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1611
Jack <an*******@disc ussions.microso ft.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.co m>
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*******@disc ussions.microso ft.com>
Sender: "Jack" <an*******@disc ussions.microso ft.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: AcOqKZh5r68wFS0 BTmu7zPcmiKZxyA ==
Newsgroups: microsoft.publi c.dotnet.genera l
Path: cpmsftngxa06.ph x.gbl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:115548
NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
X-Tomcat-NG: microsoft.publi c.dotnet.genera l

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
21094
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 the MSDN example). But is it possible that we just implement the Dispose method, which we will call at the end of the application? Will there be any memory leak or side effects?
20
7520
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, but this seems to rely on a call from the application, e.g. MyClass.Dispose()
12
2122
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 unmanaged resources such as file handles or database connections that must be released when the managed object that uses them is reclaimed."
4
314
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 take that long so that please wait until I finish my job gracefully?
7
1718
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 keyword "set" as normal vb to set an object to nothing or it is enough todo the following "myobject = nothing" instead of "set myobject = nothing " Thanks
22
3091
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 created / destroyed at user request). I can check form != null to prevent incorrect access. But, the form could disappear immediately after the check, before the method is run. Or someone could click 'close' when it's in the middle of an update. ...
10
2420
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 has queued up on each GC cycle. And We know that the garbage collector needs a minimum of two cycles (maybe more GC cycles) to reclaim Finalize objects and needs to retain all other objects reachable from them during this process. But is there any...
9
13043
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 Domain. We have both Cold Fusion and ASP.NET apps on this server and the Cold Fusion apps do not display such slowness on their first start up of the day. Is there a way to improve the load times of ASP.NET apps? I'm having to justify to my boss...
15
7422
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
9595
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10059
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10008
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3974
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.