Bug 481675 - Eclipse runs at 100% CPU in main #1 thread when not minimized
Summary: Eclipse runs at 100% CPU in main #1 thread when not minimized
Status: CLOSED DUPLICATE of bug 478962
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.5.1   Edit
Hardware: PC Linux
: P3 blocker with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks:
 
Reported: 2015-11-08 23:54 EST by Bill Chatfield CLA
Modified: 2016-04-28 15:28 EDT (History)
7 users (show)

See Also:


Attachments
Full log of stdout/stderr with kill -3 stack trace (17.27 KB, text/x-log)
2015-11-08 23:54 EST, Bill Chatfield CLA
no flags Details
Output of strace on the java/eclipse thread that is consuming the CPU (2.31 MB, text/plain)
2015-11-08 23:57 EST, Bill Chatfield CLA
no flags Details
output for #jstack -F 3351 (11.66 KB, text/plain)
2015-11-24 16:46 EST, Javier Hernandez CLA
no flags Details
output of jstack -F (multiple times) (32.81 KB, application/octet-stream)
2016-03-08 06:25 EST, Radim Hopp CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Chatfield CLA 2015-11-08 23:54:04 EST
Created attachment 257811 [details]
Full log of stdout/stderr with kill -3 stack trace

Latest Mars 4.5.1 from eclipse.org
Fedora Linux 64-bit 21, 22, & 23
Oracle Java 1.8.0_66-b17 and OpenJDK 1.7, and OpenJDK 1.8

This only happens on one of my Fedora machines (HP Compaq 6710b with Intel i915 GPU), I have another machine, a Dell, with the same version of Fedora and Eclipse, where this problem does not occur. But on the machine it does occur on, it has been happening through several versions of Fedora and Eclipse.

It also only happens after the first run. When Eclipse is installed, the installer process automatically starts Eclipse. During that run of Eclipse, it works fine. But, all subsequent runs after the first show this problem.

The 'ps -mo pid lwp pcpu' command identifies the thread that is consuming the CPU. With that I can find the Java thread in the output of jstack <pid>. It is the main #1 thread and it is doing something with a native SWT function:

"main" #1 prio=6 os_prio=0 tid=0x00007f04b0009800 nid=0x3514 runnable [0x00007f04b979c000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.gtk.OS._gdk_window_get_origin(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gdk_window_get_origin(OS.java:5814)
	at org.eclipse.swt.widgets.Control.getWindowOrigin(Control.java:5603)
	at org.eclipse.swt.widgets.Display.map(Display.java:3066)
	at org.eclipse.swt.widgets.Control.drawBackground(Control.java:132)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:5573)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4717)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:9279)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1225)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
(more in attached file)
Comment 1 Bill Chatfield CLA 2015-11-08 23:57:25 EST
Created attachment 257812 [details]
Output of strace on the java/eclipse thread that is consuming the CPU

This shows that it is polling something in a tight loop, each invocation results in an EAGAIN error, which means that whatever it's polling is not ready to send any data.
Comment 2 Bill Chatfield CLA 2015-11-09 00:01:29 EST
The Eclipse main window is displayed, but it is unusable because it is slow and some operations hang for minutes of indefinitely.
Comment 3 Bill Chatfield CLA 2015-11-09 00:17:02 EST
I believe that this also occurred under CentOS 7 on this same machine. I don't have Red Hat, but I could reinstall CentOS if that is closer to a "supported" platform than Fedora.

My guess is that there is an issue between SWT and the Linux driver for the i915 graphics card.
Comment 4 Javier Hernandez CLA 2015-11-24 16:46:37 EST
Created attachment 258260 [details]
output for #jstack -F 3351

Output form #jstack -F 3351
Comment 5 Javier Hernandez CLA 2015-11-24 16:49:22 EST
Comment on attachment 258260 [details]
output for #jstack -F 3351

I added a file with the output.

This is my kernel version: 4.2.0-1-amd64 #1 SMP Debian 4.2.5-1 (2015-10-27) x86_64 GNU/Linux

I' running debian testing

and I have this output:

  *-display               
       description: VGA compatible controller
       product: Broadwell-U Integrated Graphics [8086:1616]
       vendor: Intel Corporation [8086]
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:50 memory:c0000000-c0ffffff memory:b0000000-bfffffff ioport:4000(size=64)


for #lshw -numeric -C display
Comment 6 Radim Hopp CLA 2016-03-08 06:25:09 EST
Created attachment 260149 [details]
output of jstack -F (multiple times)

I am adding my output of jstack -F (run multiple times, just the relevant thread)

My machine:
Fedora 23

gtk3 v 3.18.7-2.fc23

java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

kernel 4.4.3-300.fc23.x86_64

$ sudo lshw -numeric -C display
  *-display               
       description: VGA compatible controller
       product: Haswell-ULT Integrated Graphics Controller [8086:A16]
       vendor: Intel Corporation [8086]
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 0b
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:46 memory:e0000000-e03fffff memory:c0000000-dfffffff ioport:3000(size=64)
Comment 7 Bill Chatfield CLA 2016-03-08 10:01:51 EST
I just want to point out that the i915 graphics driver is common to all 3 cases being reported here by different people.
Comment 8 Karel Tejnora CLA 2016-03-08 11:18:31 EST
(In reply to Bill Chatfield from comment #7)
> I just want to point out that the i915 graphics driver is common to all 3
> cases being reported here by different people.

Bill I also have i915. And the same symptoms. I tried to localise the bug by some minimal example, w/o success.
Comment 9 Balázs Zsoldos CLA 2016-04-22 19:21:16 EDT
Same issue here with Kubuntu 16.04 and HP 6710b.
Comment 10 Dima Litvinov CLA 2016-04-23 13:11:21 EDT
Hi. I've just upgraded from Ubuntu 15.10 (Kernel 4.2.0-35) to Ubuntu 16.04 LTS (Kernel 4.4.0-21) and this bug has APPEARED. Eclipse is constantly having a "progress bar" for background jobs ins the lower right corner (but details about operation are absent) and it though does not prevent but greatly slows down all the work.
And yes, I have i815.
Eclipse 20160218-0600
If some details are needed - I will gladly post them - just ask.
Comment 11 Alexander Kurtakov CLA 2016-04-23 14:30:23 EDT
Would you please try with lastest Neon I-build? There are significant changes in SWT so let's check whether it's reproducible with latest code.
Comment 12 Balázs Zsoldos CLA 2016-04-23 14:39:32 EDT
I have just tried with neon M4 and it seems that it works well. Thanks!
Comment 13 Balázs Zsoldos CLA 2016-04-23 14:40:09 EDT
I meant Neon M6.
Comment 14 Dima Litvinov CLA 2016-04-24 12:45:28 EDT
Version: Neon Milestone 6 (4.6.0M6)
Build id: 20160329-0659

Bug does not appear so far.
Comment 15 Arun Thondapu CLA 2016-04-28 15:28:43 EDT

*** This bug has been marked as a duplicate of bug 478962 ***