Re: CPU Usage 100%

From: Arkady Frenkel (arkadyf_at_hotmailxdotx.com)
Date: 07/25/04


Date: Sun, 25 Jul 2004 09:58:27 +0300

You can run apimon from Resource Kit to make windows API calls profiling in
your app during some time
Arkady

"Varun Singh" <varun@nospam.net> wrote in message
news:OjFTOyLcEHA.308@TK2MSFTNGP12.phx.gbl...
> Hi there,
> I am assuming this must be a common problem. I have an
> application (Built in VC++ 6.0 on Win2K) which connects to a server and
> downloads binary data which is parsed to draw images. The app contains a
> Socket connection (Winsock 1.1, Async Handling of Connect, Close and
Reads),
> timers which refresh the backbuffer every 20 Milliseconds and blit the
> buffer to the Window DC and an Idle Foreground Hook for my thread which
does
> some other calculation tasks. The parsing of the drawing data is handled
> within the refresh timers too. It can end up taking some time depending on
> the amount of data which comes down the socket.
> Now, the refresh timers are only initiated when the data has been
> parsed, they are not continuously running. When I start the app, the CPU
> usage hovers around 3% to 10% ... this is with all activity in full swing
> (socket I/O, redraws, idle tasks, etc.) ... this climbs up to around 40%
to
> 50% after about 5 minutes of running time. If the app is left running for
> long, then the CPU usage for my app climbs up to 100% even if the socket
is
> closed and no refreshes are taking place. The Idle timers are not active
> either. It stays that way until app shutdown. Why would this be happening
> when I have no functionality occurring?
> When I profile the app, it seems my message handling procedure and
it's
> child functions take the most time as expected; the socket message
handling
> is done in an independent hidden window (maybe this is the issue? Two
> windows and their message handlers?) ... where could the issue be? If I
> haven't provided enough information, please let me know.
>
> All input will be greatly appreciated.
>
> Regards,
> Varun
>
>



Relevant Pages

  • Re: Windows.. its like coming home!
    ... gradual transition, especially in going from OS 9 to OS X. ... They needed something that could compete with Windows, ... mean by the "2 of every app" comment before - Apple took whatever apps ... I've found that because the Dock shows applications rather than windows, ...
    (comp.sys.mac.advocacy)
  • Re: Windows.. its like coming home!
    ... gradual transition, especially in going from OS 9 to OS X. ... They needed something that could compete with Windows, ... mean by the "2 of every app" comment before - Apple took whatever apps ... I've found that because the Dock shows applications rather than windows, ...
    (comp.sys.mac.advocacy)
  • RE: Beginners Questions
    ... We do use Windows form on the presentation layer which is on ... terminal server and call web services on the business logic side. ... of using "proxy" authentication on SQL Server. ... > I have written an app with a Windows Forms UI that is deployed to clients ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Frustration level with Windows -- ARG!
    ... I can have an app sieze and you can go take a ten ... That is MS-Outlook, not Windows. ... to the processes tab, not the applications tab. ... and it tries to stop them "gently" if it can, before resorting to kill -9. ...
    (comp.sys.mac.advocacy)
  • Re: DOS applications ?
    ... A DOS batch file runs dos programs sequentially and can run ... command prompt window and keep the second command ... Windows APIs to do it. ... A 16-bit DOS app running on pure MS-DOS cannot launch another app ...
    (microsoft.public.vc.mfc)