PC Review


Reply
Thread Tools Rate Thread

CPU Usage jumps to 100%

 
 
David Schwartz
Guest
Posts: n/a
 
      9th Dec 2003
When I run my VB.NET Windows Forms application, the CPU usage jumps up to
100%. If I drop-down a menu, the usage goes down to a more reasonable
number, like 0-2%. The same is true when a MsgBox comes up.

Has anyone else noticed or experienced this? Why would this be? Is this
the norm for VB.NET apps?

Thanks in advance.


 
Reply With Quote
 
 
 
 
One Handed Man [ OHM# ]
Guest
Posts: n/a
 
      9th Dec 2003
This is normal.

OHM#

David Schwartz wrote:
> When I run my VB.NET Windows Forms application, the CPU usage jumps
> up to 100%. If I drop-down a menu, the usage goes down to a more
> reasonable number, like 0-2%. The same is true when a MsgBox comes
> up.
>
> Has anyone else noticed or experienced this? Why would this be? Is
> this the norm for VB.NET apps?
>
> Thanks in advance.


Regards - OHM# (E-Mail Removed)


 
Reply With Quote
 
One Handed Man [ OHM# ]
Guest
Posts: n/a
 
      9th Dec 2003
Actually, are you saying once started the application continues to grab 100%
until you cause a dropdown event ?, if so this is not normal. The processing
time will peak when you start the application, but should not remain in this
state after loading unless you have some thread running or some event is
continually firing which doesent sound right.

There are some free profiler tools around which can assist you in finding
bottlenecks in your application.


One Handed Man [ OHM# ] wrote:
> This is normal.
>
> OHM#
>
> David Schwartz wrote:
>> When I run my VB.NET Windows Forms application, the CPU usage jumps
>> up to 100%. If I drop-down a menu, the usage goes down to a more
>> reasonable number, like 0-2%. The same is true when a MsgBox comes
>> up.
>>
>> Has anyone else noticed or experienced this? Why would this be? Is
>> this the norm for VB.NET apps?
>>
>> Thanks in advance.

>
> Regards - OHM# (E-Mail Removed)


Regards - OHM# (E-Mail Removed)


 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a
 
      9th Dec 2003
If this is normal, what would you say to users who complain about this?
Thanks.

"One Handed Man [ OHM# ]" <terry_burnsREMOVE%FOR%NO%(E-Mail Removed)>
wrote in message news:%(E-Mail Removed)...
> This is normal.
>
> OHM#
>
> David Schwartz wrote:
> > When I run my VB.NET Windows Forms application, the CPU usage jumps
> > up to 100%. If I drop-down a menu, the usage goes down to a more
> > reasonable number, like 0-2%. The same is true when a MsgBox comes
> > up.
> >
> > Has anyone else noticed or experienced this? Why would this be? Is
> > this the norm for VB.NET apps?
> >
> > Thanks in advance.

>
> Regards - OHM# (E-Mail Removed)
>
>



 
Reply With Quote
 
One Handed Man [ OHM# ]
Guest
Posts: n/a
 
      9th Dec 2003
http://www.platformdev.com/AO2_pdProfiler.htm

Try this, it may well help define where the problem is

OHM


David Schwartz wrote:
> If this is normal, what would you say to users who complain about
> this? Thanks.
>
> "One Handed Man [ OHM# ]"
> <terry_burnsREMOVE%FOR%NO%(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> This is normal.
>>
>> OHM#
>>
>> David Schwartz wrote:
>>> When I run my VB.NET Windows Forms application, the CPU usage jumps
>>> up to 100%. If I drop-down a menu, the usage goes down to a more
>>> reasonable number, like 0-2%. The same is true when a MsgBox comes
>>> up.
>>>
>>> Has anyone else noticed or experienced this? Why would this be? Is
>>> this the norm for VB.NET apps?
>>>
>>> Thanks in advance.

>>
>> Regards - OHM# (E-Mail Removed)


Regards - OHM# (E-Mail Removed)


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      9th Dec 2003
* "David Schwartz" <(E-Mail Removed)> scripsit:
> When I run my VB.NET Windows Forms application, the CPU usage jumps up to
> 100%. If I drop-down a menu, the usage goes down to a more reasonable
> number, like 0-2%. The same is true when a MsgBox comes up.
>
> Has anyone else noticed or experienced this? Why would this be? Is this
> the norm for VB.NET apps?


Does it remain at 100% if you don't show a messagebox? Does that even
occur in a blank project? What are you doing at startup?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
One Handed Man [ OHM# ]
Guest
Posts: n/a
 
      9th Dec 2003
The OP's initial statement was not crystal clear really. I initially thought
he meant that the app peaked at 100% on startup, so I posted a follow up
question ( look above ) which he has not come back to.

I'm not sure if he has not had time, solved it or got annoyed ?

Regards - OHM



Herfried K. Wagner [MVP] wrote:
> * "David Schwartz" <(E-Mail Removed)> scripsit:
>> When I run my VB.NET Windows Forms application, the CPU usage jumps
>> up to 100%. If I drop-down a menu, the usage goes down to a more
>> reasonable number, like 0-2%. The same is true when a MsgBox comes
>> up.
>>
>> Has anyone else noticed or experienced this? Why would this be? Is
>> this the norm for VB.NET apps?

>
> Does it remain at 100% if you don't show a messagebox? Does that even
> occur in a blank project? What are you doing at startup?


Regards - OHM# (E-Mail Removed)


 
Reply With Quote
 
Dick Grier
Guest
Posts: n/a
 
      9th Dec 2003
Hi,

Something in your code is causing this. What are you doing after startup?

BTW, this IS NOT normal. However, there are things, like polling loops,
that will/can result in 100% processor usage. Also, not, that 100%
processor usage means that your process is consuming 100% of the time
allocated to it, not that it is consuming 100% of all possible time --
multitasking still works, though other apps may be slowed.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.


 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a
 
      9th Dec 2003
Thanks for the responses everyone. I solved the problem.

Don't laugh, but this is what it was:

At the end of Sub Main, there was an infinite loop with a DoEvents in it!
The purpose of this loop was apparently to keep Sub Main from ending and the
app terminating as a result. I got rid of the infinite loop and moved the
Sub Main code into a Startup form instead and now the CPU usage drops back
down after the app starts up.

"One Handed Man [ OHM# ]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The OP's initial statement was not crystal clear really. I initially

thought
> he meant that the app peaked at 100% on startup, so I posted a follow up
> question ( look above ) which he has not come back to.
>
> I'm not sure if he has not had time, solved it or got annoyed ?
>
> Regards - OHM
>
>
>
> Herfried K. Wagner [MVP] wrote:
> > * "David Schwartz" <(E-Mail Removed)> scripsit:
> >> When I run my VB.NET Windows Forms application, the CPU usage jumps
> >> up to 100%. If I drop-down a menu, the usage goes down to a more
> >> reasonable number, like 0-2%. The same is true when a MsgBox comes
> >> up.
> >>
> >> Has anyone else noticed or experienced this? Why would this be? Is
> >> this the norm for VB.NET apps?

> >
> > Does it remain at 100% if you don't show a messagebox? Does that even
> > occur in a blank project? What are you doing at startup?

>
> Regards - OHM# (E-Mail Removed)
>
>



 
Reply With Quote
 
One Handed Man [ OHM# ]
Guest
Posts: n/a
 
      9th Dec 2003
Yeah Dick, read ALL the posts before replying. I followed up my post with a
caviat

OHM


Dick Grier wrote:
> Hi,
>
> Something in your code is causing this. What are you doing after
> startup?
>
> BTW, this IS NOT normal. However, there are things, like polling
> loops, that will/can result in 100% processor usage. Also, not, that
> 100% processor usage means that your process is consuming 100% of the
> time allocated to it, not that it is consuming 100% of all possible
> time -- multitasking still works, though other apps may be slowed.
>
> Dick


Regards - OHM# (E-Mail Removed)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU usage jumps 10%-50% every second with nothing running perfb@yahoo.com Windows Vista General Discussion 2 2nd May 2007 05:12 PM
CPU Usage jumps to 100% and stays there after use... =?Utf-8?B?WmJhbGw=?= Windows XP Help 4 16th Jun 2006 04:31 PM
CPU usage jumps to 50% for no reason =?Utf-8?B?ZHlsLXBpY2tsZQ==?= Microsoft Windows 2000 5 14th Jan 2006 02:29 PM
Process CPU usage jumps to 100% without any reason? =?Utf-8?B?S2V2aW4gQ2hhYm90?= Microsoft C# .NET 1 24th May 2004 07:31 AM
Windows Explorer CPU usage jumps to 99% Haresh Gujarathi Microsoft Windows 2000 File System 0 12th Feb 2004 08:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:28 AM.