Update: Since Eclipse Mars update in Fedora 22, and with latest updates installed, the memory/CPU usage problem is fixed. Also, the problem with mylyn icons is fixed. While there are still some rendering bugs, along with some bad colors here and there; the GTK3 version is now usable for me. 🙂
Since upgrade to Fedora 22, I had several problems with Eclipse. The most annoying one, in my pretty old laptop, was nearly locking up the system after using it for awhile as reported here. I found that my 4GB RAM is almost full and kswapd is taking almost 100% CPU.
First, I suspected that it is a kernel bug since kswapd was using 100% CPU. And, it seems that it really is, but it is an old kernel problem happens when the available RAM is low. Therefore, it should not be the main reason of my problems.
Investigating more, I found the the amount of ‘shared’ memory in ‘free -m’ output keeps increasing when I use Eclipse until I’m forced to close Eclipse due to lock up. Then it is returned back to normal. I guess this is a graphics driver bug, as the Eclipse memory usage reported by ‘top’ is not changed much since its start. (and the kernel out of memory messages always happen in the driver code).
Anyway, besides, Eclipse was very ‘heavy’ on my laptop: it constantly used very high CPU usage even if I just scrolled the editor window. It was also very slow (with lag). Also Eclipse uses a new coloring for various part of the UI in F22, which are sometimes very annoying (e.g. unreadable text, unnoticeable selected region, etc). I was forced to change some colors to have a usable editor.
I was living by all these problems until yesterday, in which I found that mylyn task list is also buggy. It didn’t show unread/new issue marks beside issue icons, so I was missing new/updated issues assigned to me. I was seriously considering switching back to Fedora 21, when I suddenly found out that Eclipse is using GTK3 backend in Fedora 22 and I should be able to make it use GTK2 instead.
The first way to do this I found in Internet was setting SWT_GTK3 environment variable to 0. But it didn’t work in Fedora 22. It turns out that Eclipse has a command line argument for it, which is used by Fedora (in /etc/eclipse.ini) to force usage of GTK3 backend. So, to run Eclipse with GTK2 backend, you are forced to either modify eclipse.ini, or run eclipse with the following command line option:
eclipse --launcher.GTK_version 2
And yes, finally, it fixed all my problems with Eclipse in Fedora 22!
Posted by Links 18/7/2015: Android PC, Chromixium 1.5 | Techrights on July 19, 2015 at 3:47 am
[…] Eclipse problems on Fedora 22 […]
Posted by Anonymous on July 19, 2015 at 3:06 pm
Had similar problems with Eclipse in FC22. The switch to GTK2 works! Verified.
Posted by matejcepltest on August 1, 2015 at 8:39 pm
Except Eclipse may then randomly crashed with some various plugins for Firefox installed. (It was BlueJeans for me).
Posted by Hedayat on September 3, 2015 at 12:01 pm
Yes, but I rarely use Eclipse’s built-in browser compared to other things.
Posted by Anonymous on October 15, 2015 at 5:07 pm
Thanks. This solves problem in Mars.1 where tiling editor windows side-by-side stopped working
Posted by Hauke Stieler on December 2, 2015 at 3:02 am
The trick with the GTK2 version helped me (fedora23 and eclipse 4.5.and my eclipse, thanks a lot (also many thanks from my laptop he seems very happy with this solution 😉 )!
I also tried to edit the /etc/eclipse.ini but then it was impossible for me to start eclipse any longer (also after undoing the change) due to the error “ClassFormatException: Unknown constant tag 118 in class file org/eclpise/emf/…….”. I reinstalled eclipse and everything worked again. Nevertheless the parameter method works like a charm 🙂
Posted by Jeff Buhrt on January 8, 2016 at 1:02 am
1) Has anyone opened an Eclipse bug/ticket for this?
2) I just Google’d this blog and:
a) It drops my Eclipse from ~50% CPU when idle to ~0.3%.
b) After running ‘strace -f eclipse’ with and without the GTK2 option i realized the 10’s thousands of polls per second are the same as Firefox 43+.
Ticket for high CPU using on Firefox on Fedora:
https://bugzilla.mozilla.org/show_bug.cgi?id=508427#c111
Posted by Hedayat on February 16, 2016 at 11:50 am
I have not filled a separate bug, but it is probably needed. Eclipse in F23 is having high CPU usage with GTK3 too.
Posted by matejcepltest on March 9, 2017 at 12:23 pm
Using supported distro helps, I got numerous upgrades on F25.
Posted by Brandie on March 9, 2017 at 6:47 am
I can’t hear aninyhtg over the sound of how awesome this article is.
Posted by Antoine on January 24, 2016 at 10:54 am
Works perfectly! Many thanks!
Posted by Hedayat on February 16, 2016 at 11:40 am
🙂 You’re welcome!
Posted by [SOLVED] Eclipse create new class slow in Fedora – Lessons 4 Devs on April 15, 2016 at 7:07 pm
[…] Thanks to this person: https://hedayatvk.wordpress.com/2015/07/16/eclipse-problems-on-fedora-22/ […]
Posted by [SOLVED] Eclipse create new class slow in Fedora – Lessons 4 Dev on June 2, 2016 at 10:30 am
[…] Thanks to this person: https://hedayatvk.wordpress.com/2015/07/16/eclipse-problems-on-fedora-22/ […]
Posted by Robert on January 14, 2017 at 12:15 am
Excellent, many thanks! Works on Fendora 25 too. So long searching a solution and your one is the only one helping. Many Thanks!!
Posted by Hedayat on February 9, 2017 at 7:02 pm
🙂 You’re welcome!