473,657 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What would cause this problem? CPU usage 100%

I am writing a program which should keep running if not
interrupted. While testing the program, I noticed that when the
program was first run, the cpu usage (on WinXP) was between 0 to 2
%. In the next morning, the cpu usage had jumped to 100%. I
observed the same behavior on two different machines.

Since the program does repetitive jobs, there is no reason the cpu
load should change. What would cause this kind of behavior? I have
no clue where to start looking.
Nov 15 '05 #1
5 2913
John Smith wrote:

I am writing a program which should keep running if not
interrupted. While testing the program, I noticed that when the
program was first run, the cpu usage (on WinXP) was between 0 to 2
%. In the next morning, the cpu usage had jumped to 100%. I
observed the same behavior on two different machines.

Since the program does repetitive jobs, there is no reason the cpu
load should change. What would cause this kind of behavior?
Maybe the cpu had nothing better to do in the morning?
I have no clue where to start looking.


Probably
news:comp.progr amming

--
pete
Nov 15 '05 #2
"John Smith" <js****@company .com> wrote in message
news:k%******** ********@twiste r.southeast.rr. com...
I am writing a program which should keep running if not
interrupted. While testing the program, I noticed that when the
program was first run, the cpu usage (on WinXP) was between 0 to 2
%. In the next morning, the cpu usage had jumped to 100%. I
observed the same behavior on two different machines.

Since the program does repetitive jobs, there is no reason the cpu
load should change. What would cause this kind of behavior? I have
no clue where to start looking.


It can be a bug in the program. If the behavior is different from run to run
on the same input data, then either something is uninitialized or you're
using bad indices or bad pointers, using which at one times may give you
more or less expected results but at others not. Also can it be that you use
rand(), don't check errors or some other things, have race conditions or
simply your program goes crazy when it runs past midnight due to the
incorrect time/date handling?

Alex
Nov 15 '05 #3
John Smith <js****@company .com> writes:
I am writing a program which should keep running if not
interrupted. While testing the program, I noticed that when the
program was first run, the cpu usage (on WinXP) was between 0 to 2
%. In the next morning, the cpu usage had jumped to 100%. I
observed the same behavior on two different machines.

Since the program does repetitive jobs, there is no reason the cpu
load should change. What would cause this kind of behavior? I have
no clue where to start looking.


Not here. Try a windows group.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #4
John Smith wrote:

I am writing a program which should keep running if not
interrupted. While testing the program, I noticed that when the
program was first run, the cpu usage (on WinXP) was between 0 to 2
%. In the next morning, the cpu usage had jumped to 100%. I
observed the same behavior on two different machines.

Since the program does repetitive jobs, there is no reason the cpu
load should change. What would cause this kind of behavior? I have
no clue where to start looking.


Your program has been taking lessons from camels, whose noses
should not be allowed in tents, lest the remainder of the camel
follow.

At any rate it has nothing to do with C, and you should be asking
on some group with Microsoft, Windows, or similar verbiage in its
name. It may well be just another Windows bug, and may or may not
have any meaning.

--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Nov 15 '05 #5
John Smith wrote:
I am writing a program which should keep running if not
interrupted. While testing the program, I noticed that when the
program was first run, the cpu usage (on WinXP) was between 0 to 2
%. In the next morning, the cpu usage had jumped to 100%. I
observed the same behavior on two different machines.

Since the program does repetitive jobs, there is no reason the cpu
load should change. What would cause this kind of behavior? I have
no clue where to start looking.


You provide very little in terms of useful information so these are
really just a few stabs in the dark: did you check memory usage? If
there was a small memory leak that accumulated overnight to the point
where more memory than was physically available had been allocated,
your program may be causing the machine to thrash as it caused memory
to be swapped in/out. Is your program performing some sort of
operation whose time complexity is dependant on a factor changes as the
program runs (such as inserting items into a sorted list)?

What you should try to do is reduce the program to the smallest amount
of code that produces the issue. If you still can't figure it out and
are writing Standard C, post a minimal, complete, and compilable
example here and we can take a look at it for you.

Robert Gamble

Nov 15 '05 #6

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

Similar topics

112
10307
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please, share your experience in using IDENTITY as PK .
3
1234
by: dawn | last post by:
Hi, I have written a bot-like program, which basically does the same thing over and over again, only using different parameters. Everything goes fine, until after an hour or three, the application stops and signals a 'System.ArgumentException' When I run the debugger on the running ap it shows that the error is caused in system.drawing.dll and it tells me "invalid parameter". What could be the cause of this......every time I let the...
43
6867
by: Mountain Bikn' Guy | last post by:
I have a situation where an app writes data of various types (primitives and objects) into a single dimensional array of objects. (This array eventually becomes a row in a data table, but that's another story.) The data is written once and then read many times. Each primitive read requires unboxing. The data reads are critical to overall app performance. In the hopes of improving performance, we have tried to find a way to avoid the...
22
31963
by: Paul | last post by:
Hi I am having a real issue with CPU usage by SQL Server, and it is not related to a poor query. I have a clients database that I am currently investigating some issues with. After I perform a standard task using the application, and the results have been returned to the application the cpu usage remains at 100%.
669
25859
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
10
2087
by: rdemyan via AccessMonster.com | last post by:
My app contains utility meter usage. One of the things we have to deal with is when a usage is clearly incorrect. Perhaps someone wrote the meter reading down incorrectly or made a factor of 10 error when entering the reading, etc. At other times the usage is zero or somehow was entered as a negative number. So I'm thinking about adding functionality to search for such anomalies. For instance, show months where the meter reading is...
3
9395
by: Sirisha | last post by:
I am using the following code to get the CPU usage PerformanceCounter myCounter; myCounter = new PerformanceCounter(); myCounter.CategoryName = "Processor"; myCounter.CounterName = "% Processor Time"; myCounter.InstanceName = "_Total"; for(int i=0; i < 20; i++)
1
1952
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and accessing the webservice each min. It was working 100% fine. Problem: But now in actual deployment, we have deployed webservice in Win Server 2003 and we have used all the default configurations. Now the clients are accessing that service the same way...
3
2527
by: Arlef | last post by:
Basically, I have this piece of code and it put my cpu usages to 100%. However, in I uncomment the sleep line that sleeps the current thread the CPU tends to be about 50%. I know that this is centred around the Application.DoEvents() method. Is there a proper way to do this such that we can eliminate the call to Thread.Sleep(100); ? Form1 TheForm = new Form1(); TheForm.Show(); while(TheForm.Created) {
0
8842
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
8740
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
8513
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,...
0
8617
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
7352
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
6176
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
4173
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...
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
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.