Bug 1294697 - Eclipse consumes entire CPU as long as the window is open
Eclipse consumes entire CPU as long as the window is open
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: eclipse (Show other bugs)
23
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Roland Grunberg
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-29 14:03 EST by Dennis W. Tokarski
Modified: 2016-02-11 14:09 EST (History)
11 users (show)

See Also:
Fixed In Version: eclipse-4.5.1-7.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-11 14:09:41 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dennis W. Tokarski 2015-12-29 14:03:15 EST
Description of problem:
Eclipse consumes 80+ % of a CPU core when idle. Minimize the window and
CPU use goes to near zero. Maximize the window and it's back to 80+ %.
This is a great way to bleed a laptop battery dry in no time.


Version-Release number of selected component (if applicable):
Fedora 23 up to date as of 29 Dec 2015, 1800 UTC, kernal 4.2.8-300.fc23.x86_64
Mate Desktop 1.12.1
eclipse-platform-4.5.1-6.fc23.x86_64
java-1.8.0-openjdk-headless-1.8.0.65-13.b17.fc23.x86_64

How reproducible:
Installed F23, Mate Desktop, and *just* eclipse-platform on a VM. (Of course,
  the eclipse install pulled in all the usual supporting rpms)
Log in to a Mate desktop session, launch eclipse.
Observe high CPU use.
Always happens.
Same behavior observed on the host system.


Steps to Reproduce:
1. See above.
2.
3.

Actual results:
80+ % cpu use when eclipse window is open but otherwise idle (it's just
showing the welcome screen); minimize window, CPU % near zero; maximize
window, high CPU use again.

When CPU use is high, strace on the eclipse process shows:
[PolTec@raid-lvm-scratch Desktop]$ strace -p8507
Process 8507 attached
wait4(8521,

...and strace on java shows:
[PolTec@raid-lvm-scratch Desktop]$ strace -p8521
Process 8521 attached
futex(0x7f338b30e9d0, FUTEX_WAIT, 8522, NULL

top says it's java that's using up all the CPU time, almost like it's in a
spin lock waiting for something which never happens. So I suppose this could
be a java bug and nothing to do with eclipse.

Expected results:
Eclipse and java should be blocked and using no CPU to speak of when
there is no application interaction.

Additional info:
That's about it. Let me know if there's some way I can provide any
other info. If you just run top and start eclipse it should be
pretty blatant.
Comment 1 K H 2016-01-03 00:43:53 EST
I've seeing this same behavior.  In order to debug this, I tried stripped my eclipse-* packages to the bare minimum and it was still happening.

In installed the latest Eclipse Mars for linux from the eclipse website and then I run that, I am not seeing excessive CPU usage.  Not only did it fix cpu usage but it also cleaned a couple of other problems I've been seeing

1. The pop up dialog that lists all the files opened is no longer white text on white background
2. Hitting a breakpoint automatically switches to the Debug perspective in PDT.

Additionally, trying to uninstall eclipse-platform took about 67 other packages with it, including really basic ones like ant, regexp, java-1.8.0-openjdk-devel
Comment 2 Damien Gombault 2016-01-05 06:43:28 EST
Hi.

I use Eclipse for Apache Directory Studio plugin.
I noticed Eclipse uses a lot of CPU when idle :

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                         
31981 damien    20   0 5214316 337580  46388 S  63,8  4,2   1:23.96 java 

Some other operations (open a LDAP connection) uses a lot of CPU too (abnormal) and does not work on some LDAP servers (connection Window freezes).

When minimized (Super+H with GNOME Shell), Eclipse uses less than 1% CPU.

I think the problem is the GTK3 version of Eclipse.
If I run eclipse --launcher.GTK_version 2, it uses less than 1%CPU idleing.
Other operations (open a LDAP connection) works normally.

The bug has been reported upstream ([GTK3] Eclipse Mars SR1 consumes 60% CPU while idling) : https://bugs.eclipse.org/bugs/show_bug.cgi?id=478962
And is fixed in master : 
Gerrit change https://git.eclipse.org/r/61124 was merged to [master].
Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=87d512619f0b0b05332e4c83f651f29bfa50c5e9

I use eclipse-swt-4.5.1-6.fc23.x86_64 on Fedora 23.
Comment 3 Roland Grunberg 2016-01-05 10:52:02 EST
> The bug has been reported upstream ([GTK3] Eclipse Mars SR1 consumes 60% CPU
> while idling) : https://bugs.eclipse.org/bugs/show_bug.cgi?id=478962
> And is fixed in master :
> Gerrit change https://git.eclipse.org/r/61124 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=87d512619f0b0b05332e4c83f651f29bfa50c5e9
> 
> I use eclipse-swt-4.5.1-6.fc23.x86_64 on Fedora 23.

I'm also seeing roughly the same thing, except for me it seems to stay at around 40-50% while idle. Minimizing the window has it dropping to ~1%

The bug and patch you mention were backported as 4.5.1-6 (http://pkgs.fedoraproject.org/cgit/eclipse.git/commit/?id=f2e612a4c062c77352b386590c6885a7d6c84b94), but I've just learned from Eric that there was another issue causing cpu consumption while idle. (See https://bugs.eclipse.org/bugs/show_bug.cgi?id=484729) . It was introduced by a patch that we backported into 4.5.1.

It's currently being tested, and should find its way into f23 soon.
Comment 4 Roland Grunberg 2016-01-05 12:56:19 EST
http://pkgs.fedoraproject.org/cgit/eclipse.git/commit/?h=f23&id=47041fe34938219943e42fb412a6305b9af9bdc6 should resolve this issue. There are some other bug fixes in this commit that are unrelated.

The build is http://koji.fedoraproject.org/koji/buildinfo?buildID=709256 and will be pushed through bodhi for f23 once it completes.
Comment 5 Fedora Update System 2016-01-06 22:04:06 EST
eclipse-4.5.1-7.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-3c119d77c0
Comment 6 Fedora Update System 2016-01-08 23:28:54 EST
eclipse-4.5.1-7.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-3c119d77c0
Comment 7 Fedora Update System 2016-01-09 16:57:07 EST
eclipse-4.5.1-7.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 8 Fredy Neeser 2016-01-14 09:58:43 EST
Hi, I experience the exact same problem on Fedora 22 (high cpu load, goes away when eclipse is minimized).

# rpm -qa | grep eclipse
eclipse-ecf-core-3.12.0-1.fc22.x86_64
eclipse-egit-4.1.1-1.fc22.noarch
eclipse-filesystem-1.0-5.fc22.x86_64
eclipse-tm-terminal-4.0.0-3.fc22.noarch
eclipse-rse-3.7.0-1.fc22.noarch
eclipse-mylyn-3.16.0-2.fc22.noarch
eclipse-remote-2.0.0-2.fc22.noarch
eclipse-cdt-8.8.0-3.fc22.x86_64
eclipse-e4-importer-0.1.0-0.5.gite4610b6.fc22.noarch
eclipse-jgit-4.1.1-2.fc22.noarch
eclipse-mylyn-docs-wikitext-3.16.0-2.fc22.noarch
eclipse-platform-4.5.1-6.fc22.x86_64
eclipse-pde-4.5.1-6.fc22.x86_64
eclipse-emf-core-2.11.1-1.fc22.x86_64
devassistant-dap-eclipse-0.10.0dev-8.fc22.noarch
eclipse-pydev-4.1.0-3.fc22.x86_64
eclipse-emf-runtime-2.11.1-1.fc22.noarch
eclipse-equinox-osgi-4.5.1-6.fc22.x86_64
eclipse-swt-4.5.1-6.fc22.x86_64
eclipse-jdt-4.5.1-6.fc22.x86_64

Can we get the fix here as well?
Comment 9 Roland Grunberg 2016-01-14 10:50:00 EST
(In reply to comment #8)
> Hi, I experience the exact same problem on Fedora 22 (high cpu load, goes away
> when eclipse is minimized).

I've kicked off a scratch build of the same update for Fedora 22 (x86_64) at http://koji.fedoraproject.org/koji/taskinfo?taskID=12547911.

I'll try to confirm that the issue does in fact exist on there as well and that the build solves it. You can also try it for yourself once the build completes, if you wish.
If it can be confirmed I'll push this is an update to F22.
Comment 10 Fredy Neeser 2016-01-15 03:53:19 EST
(In reply to Roland Grunberg from comment #9)

> I've kicked off a scratch build of the same update for Fedora 22 (x86_64) at
> http://koji.fedoraproject.org/koji/taskinfo?taskID=12547911.
> 
> I'll try to confirm that the issue does in fact exist on there as well and
> that the build solves it. You can also try it for yourself once the build
> completes, if you wish.

Thanks! I cannot locate the build in koji - did the build succeed?
Comment 11 Severin Gehwolf 2016-01-15 04:43:42 EST
(In reply to Fredy Neeser from comment #10)
> (In reply to Roland Grunberg from comment #9)
> 
> > I've kicked off a scratch build of the same update for Fedora 22 (x86_64) at
> > http://koji.fedoraproject.org/koji/taskinfo?taskID=12547911.
> > 
> > I'll try to confirm that the issue does in fact exist on there as well and
> > that the build solves it. You can also try it for yourself once the build
> > completes, if you wish.
> 
> Thanks! I cannot locate the build in koji - did the build succeed?

It did. The RPMs can be found under "Output" here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=12547914
Comment 12 Fredy Neeser 2016-01-15 06:04:39 EST
(In reply to Severin Gehwolf from comment #11)

> > Thanks! I cannot locate the build in koji - did the build succeed?
> 
> It did. The RPMs can be found under "Output" here:
> http://koji.fedoraproject.org/koji/taskinfo?taskID=12547914

Ok, I downloaded eclipse platform 4.5.1-7 and updated just these packages:

  eclipse-equinox-osgi.x86_64 1:4.5.1-7.fc22
  eclipse-jdt.x86_64 1:4.5.1-7.fc22
  eclipse-pde.x86_64 1:4.5.1-7.fc22
  eclipse-platform.x86_64 1:4.5.1-7.fc22  
  eclipse-swt.x86_64 1:4.5.1-7.fc22

The high cpu load issue is gone: The java process used by eclipse is now at around 2% cpu when eclipse is idle -- previously it remained at ~ 80% cpu.

Thanks!
Comment 13 Roland Grunberg 2016-01-20 12:54:54 EST
Sorry for the delay, I guess having closed the bug, I didn't notice. I'll push a proper change to f22 now.
Comment 14 Fedora Update System 2016-01-21 11:38:01 EST
eclipse-4.5.1-7.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-cbb77ab56f
Comment 15 Fedora Update System 2016-01-23 16:28:51 EST
eclipse-4.5.1-7.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-cbb77ab56f
Comment 16 Dennis W. Tokarski 2016-01-26 16:20:28 EST
Roland, Severin,

Thanks for pushing out all these fixes. I confirm that eclipse
cpu use is back to normal for me as well.

btw, when you did the new build, did you do away with gtk2 support?

I had been using "--launcher.GTK_version 2" on the command line per
Damien Gombault in comment 2, which also worked. The bonus for me
was that eclipse then started using my preferred theme (Crux) which
is not available for gtk3. This no longer works. Oh well.

There were also a number of other rendering issues in eclipse-cdt
which remained or actually became worse. For example, hover over
a global variable name and the top half of the display box which
opened up would brifely flash the variable name and value, and
then turn solid black.

I was about to report that when a new set of openjdk rpms became
available in updates. It seemed prudent to update and confirm the
bugs before reporting, and--happy surprise!--they were all fixed!

Don't know what prompted the new java, but kudos to whoever did
that work.

eclipse-cdt is once again able to build and debug hello world,
and that's a Good Thing.
Comment 17 Mat Booth 2016-01-27 05:28:26 EST
(In reply to Dennis W. Tokarski from comment #16)
> Roland, Severin,
> 
> Thanks for pushing out all these fixes. I confirm that eclipse
> cpu use is back to normal for me as well.
> 
> btw, when you did the new build, did you do away with gtk2 support?
> 
> I had been using "--launcher.GTK_version 2" on the command line per
> Damien Gombault in comment 2, which also worked. The bonus for me
> was that eclipse then started using my preferred theme (Crux) which
> is not available for gtk3. This no longer works. Oh well.
> 


You can try setting --launcher.GTK_version in your /etc/eclipse.ini file, but GTK2 support is not really supportable these days. GTK3 is where all the development effort is.
Comment 18 Roland Grunberg 2016-02-03 12:27:18 EST
> There were also a number of other rendering issues in eclipse-cdt
> which remained or actually became worse. For example, hover over
> a global variable name and the top half of the display box which
> opened up would brifely flash the variable name and value, and
> then turn solid black.
> 
> I was about to report that when a new set of openjdk rpms became
> available in updates. It seemed prudent to update and confirm the
> bugs before reporting, and--happy surprise!--they were all fixed!

By openjdk rpms, you mean java-1.8.0-openjdk ? I'm not sure how changes to those rpms would have any impact on Eclipse tooltip rendering so that's a little concerning. If the strange tooltip behaviour is reproduced again, I'd file a separate bug for it.
Comment 19 Fedora Update System 2016-02-04 19:22:00 EST
eclipse-4.5.1-7.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
Comment 20 Dennis W. Tokarski 2016-02-04 22:49:12 EST
(In reply to Roland Grunberg from comment #18)
> > There were also a number of other rendering issues in eclipse-cdt
> > which remained or actually became worse. For example, hover over
> > a global variable name and the top half of the display box which
> > opened up would brifely flash the variable name and value, and
> > then turn solid black.
> > 
> > I was about to report that when a new set of openjdk rpms became
> > available in updates. It seemed prudent to update and confirm the
> > bugs before reporting, and--happy surprise!--they were all fixed!
> 
> By openjdk rpms, you mean java-1.8.0-openjdk ? I'm not sure how changes to
> those rpms would have any impact on Eclipse tooltip rendering so that's a
> little concerning. If the strange tooltip behaviour is reproduced again, I'd
> file a separate bug for it.


Yes, I did mean java-1.8.0-openjdk. Other things were updated at
the same time, but I don't know of any easy way to get a list of
what was updated in that batch.

If rendering issues pop up again I'll be sure to let you know!
Comment 21 Roland Grunberg 2016-02-11 14:09:41 EST
Manually marking as CLOSED (ERRATA). Not sure why the automated system didn't do this. Maybe referencing the bug in both the f23 and f22 builds confused it.

Note You need to log in before you can comment on or make changes to this bug.