Glib main loop in SWT uses 100% CPU after loading lib

Hello!

I’m working on a problem involving Java/SWT and another native lib (Chromium), which we want to embed in Eclipse. But we ran into an issue with the glib main loop of SWT.
The custom main loop in swt works perfectly fine: using a varying poll-timeout of ~16ms. But after loading JCEF (one of the Chromium Embbeded Framework solutions for Java), the loop is constantly running with a timeout of zero… resulting in 100% CPU usage.

At first glance this problem looks similar to https://discourse.gnome.org/t/cpu-100-due-to-g-io-hup/3464
But afaik, we don’t add any pipes/sockets to the glib main loop. (No calls to g_source_add*)

Debug output with G_MAIN_POLL_DEBUG enabled:

    polling context=0x7f788c1d4b90 n=5 timeout=0
    g_main_poll(5) timeout: 0 - elapsed 0.0000010000 seconds
    polling context=0x7f788c1d4b90 n=4 timeout=0
    g_main_poll(4) timeout: 0 - elapsed 0.0000020000 seconds

The gdb output to the callback_funcs of the sources seems to suggest that those are timers (besides the expected GDK X11 Event source).
Which exists before loading the plugin. At least, I couldn’t see any g_timer_* function calls in gdb after.

Are there any suggestions about how I can find out why those timers are not reset or maybe how I can find out what triggered those specific timers?

-DeepRootNine

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.