473,785 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jul 21 '05 #1
1 1683
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
--------------------
From: "Paul F. Williams" <so*****@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: <Oi************ **@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.

--

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

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

Similar topics

0
8375
by: grutta | last post by:
I am writing a windows service that will recieve notification when a USB Device is insterted into the machine. I have used the RegisterDeviceNotification and the RegisterServiceCtrlHandlerEx with a handler. The handler portion seems to fail indicating that my parameters are invalid. I am getting an error code 126 when i try to register the handler and 28 when i register for event notification. Any ideas as to what the deal is? I am...
5
6954
by: GEL | last post by:
Hi, I want to open a new browser window, let the user use that window for several minutes, and when they close, I'd like to change the page displayed in the original window. According to numerous articles found Googling, this should work, but on my WinXP system, using Firefox and IE, I get nothing (when allowing pop-ups, if pop-ups are disabled, IE reports the window is closed, Firefox gives a JS error on checking the window handle). No...
1
2440
by: Fred | last post by:
Hello, I've a question about implementing a group policy notification in c#. I've read the MSDN about this and they have a sample in C++. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/policy/policy/registering_for_policy_refresh_notification.asp (Sorry for the wrap!) I can create the events for the machine and user with the CreateEvent API en register them with the RegisterGPNotification API. But when want to do that...
1
1670
by: Hai Ly Hoang [MT00KSTN] | last post by:
Different between Notification & Message is a bit hazy for me. Anyone can explain in detail for me ? Thanks in advance !
4
13747
by: Charles Law | last post by:
Is there an event or notification that my application can receive when a USB device (or other) is plugged in? I have looked at WMI as this appears to be the right area but cannot see how to get notification when this particular event occurs. The same goes for removal as well. TIA Charles
3
4974
by: SB | last post by:
Having gone through couple of books on .NET web services, I could not find any details event notification. They all cover in detail the coomon request/response web services implementation. I would like to know how to implement the event notification from .NET web services that is related to the publisher/subscriber model. Any sample code or links to online resources would be very helpful. I need to know this in order to send events from the...
1
1506
by: barbara_dave | last post by:
Hi all, I want do Event/Notification when a USB device plugged in. I am working on a Windows 2000 computer. Is there a way to do that? Thanks a lot!
3
5542
by: geskerrett | last post by:
We have been asked to develop and application for a client that is a 'notification" system. We would like to use python, but are struggling to find the right starting point. Any suggestions, tips or sample code would be appreciated. Application outline; Machine A is running a "listener" application that is connected to a another device via the serial post and waits for events. We have not problem working with the serial port, or...
0
1808
by: Anthony Paul | last post by:
Hello everyone, I'm looking into SQL Server 2005's Notification Services and wasn't able to find a way to create a notification event service based on a DML event such as an Insert or an Update (looking into an alternative to triggers). I see that the SqlCacheDependency is based on some internal event mechanism and I'm wondering whether we can tap into it. Does anyoen have any details on what event or mechanism the SqlCacheDependency is...
0
1123
by: MattC | last post by:
I have the following code. I get an initial Subscribe event but then I get no notification in the app. I call SqlDependency.Start(DatabaseProviderHelper.ConnectionString); on the web app application_Start event I started my web app and after receiving Starting the dependancy I ran a query against the table in the Management Studio to update the table. I saw that AspNet_SqlCacheTablesForChangeNotification's changeId for that table
0
9485
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
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...
0
9958
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...
1
7506
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
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
5390
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...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
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

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.