Re: CPU usage, memory and virtual memory



Syj wrote:
Hello,

On certain occasions, some applications can consume close to 100% cpu
usage and freeze up the machine. But some apps can consume 100% cpu,
but allow you to work on other applciations. What is the difference? Is
it the memory and virtual memory consumption? Number ofpage faults?

I am working on a multithreaded MFC application, which freezes up the
machine (when it does some computations). A look at the task manager
tells me it consumes 99% cpu and a lot of memory and virtual memory
space. I would like to make sure that when my applciation computes, it
does it as fast as possible and it does not interrupt the user from
working on other applications (all real time apps).
How do I solve the problem? Either make sure that CPU usage does not
hit say more than 70%? or let the cpu hit the maximum (so that
computation is done fast), but still does not freeze the machine.? and
what are the steps should I take to solve either of this? IS there a
better newsgroup to post this question?

As you see, I have a very weak understanding of the workings of the
operating system in this reagard. Some explanatory help in what ways
can I go in solving the current problem would benefit me.


Thank you


Review the code for calls to SetThreadPriority and/or SetPriorityClass. The machine will remain responsive to the user, even when your code wants to consume 100% of the CPU, if you lower the appropriate thread priority to BELOW_NORMAL_PRIORITY_CLASS or IDLE_PRIORITY_CLASS. The basic policy provided by the OS is that the highest priority thread gets what it wants - to the extent possible.


--
Scott McPhillips [VC++ MVP]

.



Relevant Pages

  • Re: Where to find statistics for fetched programs?
    ... I got the question how frequently programmes are fetched, ... and then how much CPU they consume. ... This in order to put together kind of a hit parade of big CPU consumers & then tackle their tuning. ... RMF can't help me while Monitor I and Monitor III provide long-term data collection about system workload and resource utilization, while covering all hardware and software components of the system. ...
    (bit.listserv.ibm-main)
  • Where to find statistics for fetched programs?
    ... I got the question how frequently programmes are fetched, ... and then how much CPU they consume. ... This in order to put together kind of a hit parade of big CPU consumers & then tackle their tuning. ... RMF can't help me while Monitor I and Monitor III provide long-term data collection about system workload and resource utilization, while covering all hardware and software components of the system. ...
    (bit.listserv.ibm-main)
  • Re: Managed directsound problem under heavy CPU load
    ... Whenever you have badly behaved threads that consume 100% CPU there is going ... The correct way is to yield at least once ... frequency of the call you're probably better off calling Sleep() with a ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: calculating time taken for an operation in CPU Cycles
    ... #define EPOCHFILETIME ... to be 0.But how can a operation consume no CPU cycle or time (in ...
    (alt.lang.asm)
  • Re: powerd freeze with amd 5000 X2 but not with lower cpus
    ... computer freezes some seconds after powerd is started. ... I thought it is MB related and did the same and again the 5000 cpu ... freeze, the smaller ones not. ...
    (freebsd-stable)

Loading