What is gtk_main_do_event doing? [message #983930] |
Wed, 14 November 2012 04:01  |
Eclipse User |
|
|
|
We're currently examining some of our Eclipse environments (Eclipse 3.6) with a profiler and we have seen that a lot of time is spent in org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8189). It seems that sometimes a lot of time is event spent in there without the user actually using Eclipse at all?
Any hints on how the method is used and why some much time is spent in it?
I have tried to read up on it but I don't have the whole context clear to me so the documentation for the method does not speak to me.
/Alex
|
|
|
|
|
|
|
|
|
|
Re: What is gtk_main_do_event doing? [message #985897 is a reply to message #985894] |
Fri, 16 November 2012 10:27   |
Eclipse User |
|
|
|
One other detail is that if it is the Mozilla case then you may not see
its event code at the GTK link I provided because I think Mozilla
defines some custom event types for its own internal use.
Grant
On 11/16/2012 10:24 AM, Grant Gayed wrote:
> Even better, you can determine this on your end by putting a breakpoint
> in SWT's OS.gtk_main_do_event(...) method (where it invokes
> _OS.gtk_main_do_event(...)), and in the breakpoint's properties set the
> condition to:
>
> System.out.println("type: " + OS.GDK_EVENT_TYPE(event)); return false;
>
> This will print each event type to stdout but will not stop execution.
> Debug your app, don't run it otherwise the breakpoint condition code
> will not be executed. You can then look up the event types at
> http://developer.gnome.org/gdk/2.22/gdk-Events.html#GdkEventType . Try
> this with
> git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet1.java
> and you'll see that the event queue goes quiet if you aren't mousing
> within the Shell, etc.
>
> I'm going to make a guess that your case that shows a lot of events
> involves viewing a Mozilla-based Browser control, because the native
> renderer is known to fire a lot of timer events, possibly among others.
>
> Grant
>
>
> On 11/16/2012 1:41 AM, Alexander Jiteg wrote:
>> So if we have a lot of action in this method without even using the
>> machine, is't due to some native event? Any suggestions on what type of
>> event that can be in this case?
>>
>> Thanks
>
|
|
|
|
Re: What is gtk_main_do_event doing? [message #987549 is a reply to message #983930] |
Tue, 27 November 2012 01:36  |
Eclipse User |
|
|
|
Hi again,
I haven't really made any big progress on this but I don't want to leave this thread hanging if someone else bump into it.
I have tried the debug-procedure suggested above and it indeed helps me to understand what applications are firing events. Thanks for that.
I have however not been able to recreate a scenario where an application is constantly firing events or to get a freeze in OS.gtk_main_do_event(...).
At the moment I suspect that the behavior occurs when the user is killing his remote desktop session (not finishing it gracefully by shutting down running programs) or when the remote desktop session is idling. Maybe some kind of screen saver could cause this?
|
|
|
Powered by
FUDForum. Page generated in 0.06538 seconds