try/catch on performance gather runs amuck..sometimes

  • Thread starter Thread starter Greg Merideth
  • Start date Start date
G

Greg Merideth

I have a custom service running under win2k3 that grabs performance data
and stores it into a sql database. I've noticed on occasion when the
data gathering stops, using the sysinternals process explorer that the
open handles of the process rocket from the usual 120+ to around 3-4,000
and every few seconds the handles increase into oblivion unless I kill
the process.

Using my own xml logger, I've pinned the code that causes the run away
handles to this:

try
{
totalUCEMessages=(int)Math.Round(_perfmonT.NextValue());
totalMessagesScanned = (int)Math.Round(_perfmonT.NextValue());
}
catch(Exception exceptionError)
{
xmlLogger.AddWindowsEvent("General Exception " +
exceptionError.Message,_ON_START_,
FwdTech.Utilities.Logging.XmlEventLogger.EventClass.Information);
}

The performance values I'm attempting to read from are the microsoft
intelligent messaging filter for exchange.

Now, the system event log never gets the general exception message
posted to it so the hang-up is in the use of .NextValue(). Is there a
possible threadding issue I'm not aware of with performance gathering
use thats causing the runaway threads?

Thanks for any suggestions.
 
Greg,

As far as I know, there is not. While I don't know of the issue, there
are actually two other pieces of code that are being run:

exceptionError.Message
FwdTech.Utilities.Logging.XmlEventLogger.EventClass.Information

Are you sure either of these isn't the cause? Also, in the
AddWindowsEvent method, is there any code in there before it writes to the
event log which could be causing the handles to open?

Hope this helps.
 
Back
Top