473,938 Members | 4,155 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CPU usage max'd out in ".NET SystemEvents" thread

Hi,

We have an app which, every now and then, has very high CPU usage.
Profiling under perfmon shows it to be thread #3 which is running at >=95%.

I took a process dump and looked at thread #3 in WinDbg and it's a thread
called ".NET SystemEvents"
The stack trace looks like this :

0:003!ClrStack -all

Thread 3

ESP EIP

ESP/REG Object Name

0x08a3fc6c 0x7b240ce2 [DEFAULT] [hasThis] Void
Microsoft.Win32 .SystemEvents.W indowThreadProc ()

EDI 0x08a3fcc8 ESI 0x00000001 EBX 0x00000000 EDX 0x0000000a ECX
0x00000000

EAX 0x00000000 EBP 0x08a3fcd8 ESP 0x08a3fc6c EIP 0x7b240ce2

ESP/REG Object Name

0x8a3fc78 0x652daf4 Microsoft.Win32 .SystemEvents

0x8a3fd64 0x79b7d2c8 System.Array

0x8a3fd68 0x79b7d2c8 System.Array

0x8a3fe14 0x79b7d2c8 System.Array

0x8a3fe18 0x79b7d2c8 System.Array

0x08a3fed8 0x791da717 [FRAME: GCFrame]
and sometimes looks like this (I took a few snapshots) :

Thread 3

ESP EIP

0x08a3fc4c 0x01d9ac94 [FRAME: NDirectMethodFr ameStandalone] [DEFAULT]
Boolean Microsoft.Win32 .UnsafeNativeMe thods.PeekMessa ge(ByRef ValueClass
MSG,ValueClass System.Runtime. InteropServices .HandleRef,I4,I 4,I4)

ESP/REG Object Name

0x08a3fc64 0x7b240cdd [DEFAULT] [hasThis] Void
Microsoft.Win32 .SystemEvents.W indowThreadProc ()

EDI 0x08a3fcc8 ESI 0x00000001 EBX 0x00000000 EDX 0x00000008 ECX
0x00000000

EAX 0x00000000 EBP 0x08a3fcd8 ESP 0x08a3fc64 EIP 0x7b240cdd

ESP/REG Object Name

0x8a3fc78 0x652daf4 Microsoft.Win32 .SystemEvents

0x8a3fd64 0x79b7d2c8 System.Array

0x8a3fd68 0x79b7d2c8 System.Array

0x8a3fe14 0x79b7d2c8 System.Array

0x8a3fe18 0x79b7d2c8 System.Array

0x08a3fed8 0x791da717 [FRAME: GCFrame]
Can anyone suggest what's going on? When the app is restarted it behaves
normally - i.e. consumes virtual 0% CPU.

TVMIA,

- Adam.

=============== ===============
Ad*********@Omn ibus.NOSPAMMYSP AMSPAM.co.uk
Jun 20 '07 #1
4 3691
"Adam Benson" <Ad*********@NO SPAMMYSPAM.omni bus.co.ukwrote in message
news:OU******** ******@TK2MSFTN GP02.phx.gbl...
Hi,

We have an app which, every now and then, has very high CPU usage.
Profiling under perfmon shows it to be thread #3 which is running at
>=95%.

I took a process dump and looked at thread #3 in WinDbg and it's a thread
called ".NET SystemEvents"
The stack trace looks like this :

0:003!ClrStack -all

Thread 3

ESP EIP

ESP/REG Object Name

0x08a3fc6c 0x7b240ce2 [DEFAULT] [hasThis] Void
Microsoft.Win32 .SystemEvents.W indowThreadProc ()

EDI 0x08a3fcc8 ESI 0x00000001 EBX 0x00000000 EDX 0x0000000a ECX
0x00000000

EAX 0x00000000 EBP 0x08a3fcd8 ESP 0x08a3fc6c EIP 0x7b240ce2

ESP/REG Object Name

0x8a3fc78 0x652daf4 Microsoft.Win32 .SystemEvents

0x8a3fd64 0x79b7d2c8 System.Array

0x8a3fd68 0x79b7d2c8 System.Array

0x8a3fe14 0x79b7d2c8 System.Array

0x8a3fe18 0x79b7d2c8 System.Array

0x08a3fed8 0x791da717 [FRAME: GCFrame]
and sometimes looks like this (I took a few snapshots) :

Thread 3

ESP EIP

0x08a3fc4c 0x01d9ac94 [FRAME: NDirectMethodFr ameStandalone] [DEFAULT]
Boolean Microsoft.Win32 .UnsafeNativeMe thods.PeekMessa ge(ByRef ValueClass
MSG,ValueClass System.Runtime. InteropServices .HandleRef,I4,I 4,I4)

ESP/REG Object Name

0x08a3fc64 0x7b240cdd [DEFAULT] [hasThis] Void
Microsoft.Win32 .SystemEvents.W indowThreadProc ()

EDI 0x08a3fcc8 ESI 0x00000001 EBX 0x00000000 EDX 0x00000008 ECX
0x00000000

EAX 0x00000000 EBP 0x08a3fcd8 ESP 0x08a3fc64 EIP 0x7b240cdd

ESP/REG Object Name

0x8a3fc78 0x652daf4 Microsoft.Win32 .SystemEvents

0x8a3fd64 0x79b7d2c8 System.Array

0x8a3fd68 0x79b7d2c8 System.Array

0x8a3fe14 0x79b7d2c8 System.Array

0x8a3fe18 0x79b7d2c8 System.Array

0x08a3fed8 0x791da717 [FRAME: GCFrame]
Can anyone suggest what's going on? When the app is restarted it behaves
normally - i.e. consumes virtual 0% CPU.

TVMIA,

- Adam.

=============== ===============
Ad*********@Omn ibus.NOSPAMMYSP AMSPAM.co.uk

It looks like you are creating/handling windows on another thread than the
main thread (thread 3). That could be because you are calling into COM on
this thread, or that you are creating Windows forms on this thread, or you
are calling DoEvents or ....
Anyway there is a message loop running in thread 3.
It's really hard to tell what's really happening here without some detailed
context or without seeing some code.

Willy.

Jun 20 '07 #2
It's really hard to tell what's really happening here without some
detailed context or without seeing some code.
Well in that thread none of our code is running, which is what was puzzling
me so much.

But your comments have given me a place to start looking - some of our
programmers, especially the juniors, are not that careful about only doing
UI work on the UI thread. I don't think there are any COM objects in that
particular app so I guess we'll have to comb it for windows, UI work outside
of thread 0. Sound like a reasonable plan of attack?

Thanks,

Adam.
==========
Jun 20 '07 #3
"Adam Benson" <Ad*********@NO SPAMMYSPAM.omni bus.co.ukwrote in message
news:up******** *****@TK2MSFTNG P02.phx.gbl...
>It's really hard to tell what's really happening here without some
detailed context or without seeing some code.

Well in that thread none of our code is running, which is what was
puzzling me so much.

But your comments have given me a place to start looking - some of our
programmers, especially the juniors, are not that careful about only doing
UI work on the UI thread. I don't think there are any COM objects in that
particular app so I guess we'll have to comb it for windows, UI work
outside of thread 0. Sound like a reasonable plan of attack?

Thanks,

Adam.
==========
I would not exclude COM, some components in the framework are just wrapping
some underlying COM components, I'm afraid this is the case here because the
thread seems to run an event handler for windows events.

Willy.

Jun 20 '07 #4
I think we got it - started looking at where that thread came from.

It was created when the app's main form was created and the first textbox
was created.
The cause - our main method was missing the [STAThread] attribute.

Hopefully, this will fix the issue.

====
Adam.
Jun 21 '07 #5

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

Similar topics

10
1891
by: george young | last post by:
I had developed the habit of using the neat python form: if someinstance: someinstance.memb() because it seems cleaner than "if someinstance is not None". {please no flames about "is not None" vs. "!= None" ...} This seemed like a good idea at the time :(). Twice, recently, however, as my app grew, I thought, hmm... it would make things clearer if I gave
0
1595
by: Steve | last post by:
Hi, Is there something fundamentally wrong with the following query? SELECT MAX(OrderID) AS Expr1 FROM Orders WHERE (MarketActionCode = 'S') AND (OrderLegCode = 'S') AND (Status = 'F') AND (AttemptID IN (SELECT AttemptID FROM ATTEMPT WHERE EventID = ?)) I pass in the EventID (in this case 1). the query returns the correct OrderID when I test it in sql2000 but for some reason fails to return a value when I use Java code. There is...
1
2693
by: PeteCresswell | last post by:
I'm working on a new report in an MS Access DB. The first anomaly was a message "This action will reset the current code in break mode." when the report was run. Seems TB something about my Detail1_Print(): if I answer "No" to the dialog the report just runs. If I answer "Yes", it pops a new dialog seemingly at every line. Code is below. The real zinger, however, started on Friday. When I run the report in question somehow MS...
3
2112
by: Serious_Practitioner | last post by:
Good day, and thank you in advance for any assistance you can provide. I have a table in an Access 2000 .mdb file, and I've run into something odd and insolvable, at least for me. The database is for membership information. This particular table, called tblMembershipInfo, has fields/columns as follows - fldMemNum - Member Number fldActionDate - The date when the entry was made in that row - Data type is Date/Time, no format specified
8
3098
by: abcd | last post by:
I can get the value on the form at the server side by using Request.form("max") when max field is disabled I dont get value. For GUI and business logic purpose I have disabled some fields with the values, but when I update Request.form does not return me anything for disabled fields. How to read disabled fields at the server side
9
1863
by: schuetz | last post by:
Hi @ll, I'm working on a web project which has to use multiple channels to connect to receive several sources at once. The problem is, that I'm not aware of the maximum amount of Threads i can allocate to my channels. Can i open 10 threads, 100 threads even 1000? is there a general answer to it. my dev. environment runs on win. xp
4
3366
by: Niron kag | last post by:
Hi, I have a windows service, which is currently installed, on my local computer. The problem is that when I look at the task manager, I see that the “Mem Usage”, become bigger and bigger. Has someone any idea why this happens? Anyway to solve this problem I thought to stop the service and start it programmatically when it’s “Mem Usage” is too big. Is it possible?
10
8446
by: JDT | last post by:
Hi, Can someone provide me an example that uses std::max_element() (probablly the predicate version) to return the max "absolute" integer in a vector? Your help is much appreciated. Tony ps.
10
2475
by: anonymous | last post by:
How can I set report output parameter "Page 1 of max" to get output on first page in minimum time as it takes much time in fetching max page no. in first page and report is of around million pages
0
10126
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
11515
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
10652
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
9854
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8209
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
6287
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4900
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
4442
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3495
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.