English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
LablGTK app maxes out CPU
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-07-06 (16:51)
From: Jerome Vouillon <Jerome.Vouillon@p...>
Subject: Re: [Caml-list] LablGTK app maxes out CPU
On Wed, Jul 05, 2006 at 05:24:54PM -0600, Matt Gushee wrote:
> Thanks for the tip. This does indeed eliminate the errors with a 
> non-blocking channel. But I still get excessive CPU usage. I have also 
> tried setting the priority on add_watch (both `DEFAULT_IDLE and `LOW). 
> Nothing seems to make any difference. It's true that my app does allow 
> other programs to grab a significant amount of CPU time when they need 
> it. But when my app is idle and not much else is running, 'top' shows it 
> using over 90% of the CPU. That's certainly not normal, and I would 
> think very undesirable.

You should try to run your program with the strace program, which
traces system calls.  This will tell you why your program runs
continuously rather than waiting for I/Os.

-- Jerome