473,739 Members | 5,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c# Timer -- .NET performance counters on this system are corrupt

I made a program using the Timer class, and I start the timer with
Timer.Start(), but don't stop it with Timer.Stop(), and I assumed this
was ok, but, Process Explorer informs me, after running it about 10 or
20 times:

---------------------------
Process Explorer
---------------------------
The .NET performance counters on this system are corrupt.
Run Exctrlst from the Microsoft Windows Resource Kit to repair them.
---------------------------
OK
---------------------------

Is this because Timer can't clean itself up? (And I have no idea what
Exctrlst is.)

Zytan
Jun 27 '08 #1
10 3072
On Fri, 27 Jun 2008 15:00:35 -0700, Zytan <zy**********@g mail.comwrote:
I made a program using the Timer class, and I start the timer with
Timer.Start(), but don't stop it with Timer.Stop(), and I assumed this
was ok, but, Process Explorer informs me, after running it about 10 or
20 times:

---------------------------
Process Explorer
---------------------------
The .NET performance counters on this system are corrupt.
Run Exctrlst from the Microsoft Windows Resource Kit to repair them.
Does the problem resolve itself? For example, if you reboot? Or is it
persistent?

If it's persistent, you may want to read through these links:

http://blogs.msdn.com/mikedodd/archi...17/243799.aspx
(Note the date...you'll want to look in your .NET installation for the
most up-to-date .ini file, using the blog entry as a guide)

http://channel9.msdn.com/forums/Tech...are-corrupted/

http://support.microsoft.com/kb/300956

Maybe something in there will help.

Either way, if and when you get your perf counters fixed, can you
reproduce the problem at will? You are vague about which Timer class
you're using, but I don't really see why failing to stop an instance of
any of the Timer classes would corrupt your performance counters. That
sounds like a bug to me (in .NET).

Pete
Jun 27 '08 #2
Thanks for the reply, Pete.

Does the problem resolve itself? For example, if you reboot? Or is it
persistent?
The error only appeared once, and I rebooted, and I have not seen it
since. Although, I have not done much development since, so this
doesn't mean much.

I should NOTE that I've used the System.Windows. Forms.Timer before,
many times, in this exact manner (letting the form destruct it without
telling it to stop explicitly), and I have never seen this error
before.

However, it seemed strange that it appears right after I about 20 or
30 test runs of a really, really simple application that does nothing
more than making a System.Windows. Forms.Timer, and uses it to update a
rich text box. Note that it didn't appear right away, but only after
30 or 60 minutes of development and test running the program.

If it's persistent, you may want to read through these links:

http://blogs.msdn.com/mikedodd/archi...17/243799.aspx
(Note the date...you'll want to look in your .NET installation for the
most up-to-date .ini file, using the blog entry as a guide)

http://channel9.msdn.com/forums/Tech...ounters-are-co...

http://support.microsoft.com/kb/300956
Thanks for these links. I will update this thread if the problem
continues, with further information. As of yet, I specifically stop
the timer before the form closes, to see if this will resolve the
situation.

Either way, if and when you get your perf counters fixed, can you
reproduce the problem at will?
No, I cannot. I will mess with this and see if I can do this, and let
you know.

You are vague about which Timer class
you're using,
System.Windows. Forms.Timer

but I don't really see why failing to stop an instance of
any of the Timer classes would corrupt your performance counters. That
sounds like a bug to me (in .NET).
I agree.

Zytan
Jun 28 '08 #3
Either way, if and when you get your perf counters fixed, can you
reproduce the problem at will?

No, I cannot. I will mess with this and see if I can do this, and let
you know.
I cannot repro the issue. Perhaps it takes some time before Process
Explorer discovers it, I am not sure. I'll post back with any
findings.

Zytan
Jun 28 '08 #4
On Sat, 28 Jun 2008 12:38:52 -0700, Zytan <zy**********@g mail.comwrote:
[...]
>You are vague about which Timer class you're using,

System.Windows. Forms.Timer
In that case I am definitely skeptical that your corrupted counters have
anything to do with the use of the Timer class.
System.Windows. Forms.Timer uses WM_TIMER, if I recall correctly, and that
should not have anything to do with the performance counters.

Please do keep us updated if you see it happen again and you can determine
more specifics about the issue.

Pete
Jun 28 '08 #5
System.Windows. Forms.Timer
>
In that case I am definitely skeptical that your corrupted counters have
anything to do with the use of the Timer class.
System.Windows. Forms.Timer uses WM_TIMER, if I recall correctly, and that
should not have anything to do with the performance counters.
That would make sense, but I am uncertain how WM_TIMER is
implemented. The multi-media timer is probably good enough, though,
it normally has 0.001 seconds accuracy, which is all WM_TIMER has
through its invocation, so it probably uses the MM timer.

Please do keep us updated if you see it happen again and you can determine
more specifics about the issue.
I have not seen it appear since. And, I am not running ANY software
that uses the performance counters, so it's just strange that I got
the error at all. The only thing remotely linked to it was the usage
of System.Windows. Forms.Timer for 30 minutes just before it
occurred...

Thanks, Pete.

Zytan
Jun 30 '08 #6
On Mon, 30 Jun 2008 13:43:48 -0700, Zytan <zy**********@g mail.comwrote:
System.Windows. Forms.Timer

In that case I am definitely skeptical that your corrupted counters have
anything to do with the use of the Timer class.
System.Windows .Forms.Timer uses WM_TIMER, if I recall correctly, and
that
should not have anything to do with the performance counters.

That would make sense, but I am uncertain how WM_TIMER is
implemented.
Oddly enough, even after all these years I have never bothered to look
into that. :) However, the important thing to know is that it's an
unmanaged window message having zero to do with .NET. Since it's
specifically the ".NET performance counters" that were corrupted, there
really should be no connection.
The multi-media timer is probably good enough, though,
it normally has 0.001 seconds accuracy, which is all WM_TIMER has
through its invocation, so it probably uses the MM timer.
I doubt it. Actually, let me rephrase that...I know for a fact that the
winmm timer is different from the WM_TIMER timer. One particular
difference is that the winmm timers have better accuracy, in that WM_TIMER
is subject to the whims of the Windows thread scheduler, while the winmm
timer is implemented in a way to minimize the difference.

I wish I could recall more details, but my knowledge in that area "has
been lost to the sands of time", as they say. :)

Pete
Jul 1 '08 #7
That would make sense, but I am uncertain how WM_TIMER is
implemented.

Oddly enough, even after all these years I have never bothered to look
into that. :)
Me neither!

However, the important thing to know is that it's an
unmanaged window message having zero to do with .NET. Since it's
specifically the ".NET performance counters" that were corrupted, there
really should be no connection.
Agreed.

The multi-media timer is probably good enough, though,
it normally has 0.001 seconds accuracy, which is all WM_TIMER has
through its invocation, so it probably uses the MM timer.

I doubt it. Actually, let me rephrase that...I know for a fact that the
winmm timer is different from the WM_TIMER timer. One particular
difference is that the winmm timers have better accuracy, in that WM_TIMER
is subject to the whims of the Windows thread scheduler, while the winmm
timer is implemented in a way to minimize the difference.
Ah, didn't know that. I assumed they were the same timer.

But, WM_TIMER has to be based on the MM timer or the high performance
counter, one or the other, unless there's other counters I don't know
about (is the 18.2 Hz clock another counter, or is it the MM timer?).
I just assumed WM_TIMER was based on the MM timer.

I wish I could recall more details, but my knowledge in that area "has
been lost to the sands of time", as they say. :)
I'm not going to worry about this. If the problem crops up again,
I'll report back with findings, and do some more digging, but until
then, I have more important things to worry about ;)

Thanks, Pete

Zytan
Jul 2 '08 #8
On Wed, 02 Jul 2008 12:47:48 -0700, Zytan <zy**********@g mail.comwrote:
[...]
But, WM_TIMER has to be based on the MM timer or the high performance
counter, one or the other, unless there's other counters I don't know
about (is the 18.2 Hz clock another counter, or is it the MM timer?).
I just assumed WM_TIMER was based on the MM timer.
WM_TIMER predates winmm for sure (the multimedia timer was introduced to
address some of the limitations of WM_TIMER).

As I said, I don't actually know the specific implementation of WM_TIMER.
But I see no reason that it _must_ be based on some other timer that you
know about. It's entirely possible that Windows handles WM_TIMER
independently of any other timers.

Pete
Jul 3 '08 #9
WM_TIMER predates winmm for sure (the multimedia timer was introduced to
address some of the limitations of WM_TIMER).
Ah.
As I said, I don't actually know the specific implementation of WM_TIMER.
But I see no reason that it _must_ be based on some other timer that you
know about. It's entirely possible that Windows handles WM_TIMER
independently of any other timers.
Yes, true.

Zytan
Jul 3 '08 #10

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

Similar topics

0
2067
by: Christopher Attard | last post by:
Hi, I need to create a dialog like the 'Add Counters' dialog box in perfmon. I'm using the System.Diagnostics namespace class in .NET and I've managed to do it. The problem arises when I'm using such dialog box on a non-English Windows OS (I'm currently testing on Spanish WinXP Professional). I'm noticing that on non-English Windows OS there are some categories whose
7
4806
by: James | last post by:
Hi Has anybody had any experience of ASP.Net performance counters not updating. In the performance monitor application when I try to add the groups ASP.NET and ASP.NET Applications the counters all show 0. In addition, ASP.NET Applications does not show any of the ASP.NET instances that are running on the computer. The other counters for example % processor time work fine. The problem machine is a test server running Win2003. ...
1
2451
by: jvn | last post by:
I am experiencing a particular problem with performance counters. I have created a set of classes, that uses System.Diagnostics.PerformanceCounter to increment custom performance counters (using .Net 2.0) The performance counter categories have been successfully created. When the set of classes are used by a WinForm test harness application, they function as expected, and the performance counters can be seen to be updated by using the...
1
6663
by: Robert Strickland | last post by:
I have a .Net web service (written for 1.1 Framework using C#) running on Windows 2003 with all latest patches. To help monitor the service, the code creates several performance counters. One server (this is a farm) I receive the following exception when trying to create the performance counters. We had an earlier issue where the ASPNET user account did not have the 'Performance Monitor' group. The exception was an access denied when trying...
0
8792
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
9479
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
9337
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
9266
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,...
1
6754
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
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3280
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
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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.