Re: Slow gui response - need to see gtk queue



On Tue, 2007-01-30 at 12:40 -0800, Mark Richardson wrote:
I can't figure out why my gui becomes sluggish.  I have a main window with a bunch of vboxes and hboxes - 
in one area, I don't put in a widget - because I load glade.xml files (so you can swap your views).  I 
should say that I have some custom widgets, and I've been pulling them out so I can see if the fault lies 
in my code or not.  But, when the application is first run, everything is fast.  If I leave it up for a few 
hours (or overnight) - it becomes very slow.  Even the mouse over of a button highlight takes 5 or 6 
seconds.
   
  I'm assuming that the fault lies in my custom widgets, and that they are calling redraw too much, so it 
creates a "back-log" of redraws in the gtk even queue.  But I don't know how to look at the event queue to 
determine the true cause.  I've run the debugger and stopped it a bunch of times, but that's hit or miss.  
Is there anyway to examine the queue in a debugger?
   
  This application is designed for showing information - not really processing user/gui events.  As data 
comes in, it updates different displays.  I've played around with the frequency of updating the gui and 
that doesn't seem to help (even 1 second per gui update becomes slow).
   
  The custom widgets I wrote can run overnight without delay when I code them into an application - so I'm 
starting to think that maybe the xml parser or how gtk handles the xml widgets might be the culprit.
   
  Thanks in advance for any help that you can provide - I can't seem to get this one, and I don't know what 
else to try.
  Mark

I dont think your problem has to do with the frequency at which you
update the GUI, typically when data arrives, you update your private
data representation of what should be displayed and then flag your UI as
"dirty" - whenever you happen to get a chance later on... you go and
actually update the GUI (i.e. no matter how many times you go and
call gdk_window_invalidate_region(), that region will only be "dirty"
once untill the server sends an expose event and your widget updates
widget->window).

Rather, 
  a.) Does your program or other programs on your desktop consume alot
      of memory (is your program getting swapped out after time ?), does
      it become responsive again after poking it ?

  b.) Is it possible that you are leaking event sources ?
      (GSourceFuncs fed to g_idle_add/g_timeout_add that neglect to
      return FALSE ever, or are accumulated over time without
      properly bookkeeping the event source id and calling
      g_source_remove())

Cheers,
                -Tristan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]