Bug 442272 - [IDE] Main thread runs @100 CPU for no reason, freezes the IDE for 1-3 second
Summary: [IDE] Main thread runs @100 CPU for no reason, freezes the IDE for 1-3 second
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.3.2   Edit
Hardware: PC Windows 8
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2014-08-21 10:16 EDT by Daniel Marcotte CLA
Modified: 2019-11-27 07:46 EST (History)
1 user (show)

See Also:


Attachments
Snapshot with Yourkit of the main thread being stuck (127.21 KB, image/png)
2014-08-21 10:16 EDT, Daniel Marcotte CLA
no flags Details
Yourkit snapshot (127.21 KB, image/png)
2014-08-21 10:17 EDT, Daniel Marcotte CLA
no flags Details
CPU (132.73 KB, image/png)
2014-08-25 10:57 EDT, Daniel Marcotte CLA
no flags Details
Thread (150.08 KB, image/png)
2014-08-25 10:57 EDT, Daniel Marcotte CLA
no flags Details
Snapshot using jvisualvm (13.48 KB, application/octet-stream)
2014-08-25 11:05 EDT, Daniel Marcotte CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Marcotte CLA 2014-08-21 10:16:57 EDT
Created attachment 246209 [details]
Snapshot with Yourkit of the main thread being stuck

Hello,

My team and I have a huge problem with eclipse since many months. We tried to figure it out but without solution. We have projects that have 60 to 70 referenced libraries in eclipse, most of them have the source code included.

Here's the problem : 

When I double-click on a class in the IDE or copy text or ctrl+click on a class to see its reference, the main thread of Eclipse goes crazy to 100% cpu for 1-3 seconds and the whole IDE freezes. It happens randomnly but several times per minutes.

We have the problem with Eclipse Indigo, Juno, Kepler, Kepler v2 and Luna.
Deactivating the save action doesn't solve the problem. 

Here's my eclipse.ini file (I've tried many configs without better result)
-Xms128m
-Xmx4096m
-XX:PermSize=256m
-XX:MaxPermSize=512M
-Xss2m
-server
-XX:+DoEscapeAnalysis
-XX:+UseConcMarkSweepGC

Attached : Yourkit picture of my profiling

My computer : 
Core i7-4470 3.4GHZ
16GB RAM
Eclipse and its code base runs on SSD

We truly consider switching to another IDE for the whole company if we don't find a solution soon.
Comment 1 Daniel Marcotte CLA 2014-08-21 10:17:38 EDT
Created attachment 246210 [details]
Yourkit snapshot
Comment 2 Paul Webster CLA 2014-08-21 17:10:30 EDT
If you can reproduce in Luna, can you take a few thread snapshots while it's pegged the CPU?

PW
Comment 3 Daniel Marcotte CLA 2014-08-25 10:56:59 EDT
I jsut reproduced it with Eclipse 4.5.0M1 (Mars). I still have the same exact behavior.

When I double click on an interface or a class in my code, the main thread freezes for a long time.

I'll upload two snapshots in a few seconds.
Comment 4 Daniel Marcotte CLA 2014-08-25 10:57:26 EDT
Created attachment 246316 [details]
CPU

Eclipse Mars
Comment 5 Daniel Marcotte CLA 2014-08-25 10:57:43 EDT
Created attachment 246317 [details]
Thread

Eclipse Mars
Comment 6 Daniel Marcotte CLA 2014-08-25 11:05:23 EDT
Created attachment 246318 [details]
Snapshot using jvisualvm

Here's a snapshot using JVisualVM using default JDK provided with Eclipse.
Comment 7 Daniel Marcotte CLA 2014-08-25 11:09:09 EDT
Look at my snapshot : 

It looks like there's a problem in the "mouseMove" event looking for "searchAllTypeNames". I think that's the CPU Hungry code.
Comment 8 Daniel Marcotte CLA 2014-09-16 10:48:18 EDT
Well, we're switching to JetBrain's IntelliJ. We may consider using Eclipse again if you fix this problem some day.
Comment 9 Daniel Rolka CLA 2014-09-16 11:19:36 EDT
(In reply to Daniel Marcotte from comment #8)
> Well, we're switching to JetBrain's IntelliJ. We may consider using Eclipse
> again if you fix this problem some day.

I would try to play a bit with different JVMs used to run the Eclipse. I haven't checked it, but maybe it can fix the issue somehow. 

Obviously we will try to look at this issue and data you have attached

thanks,
Daniel
Comment 10 Daniel Marcotte CLA 2014-09-16 11:22:32 EDT
Alright, I'll try with the latest JDK (7u67) and enforce it within Eclipse.


I'll tell you if the problem persists.
Comment 11 Daniel Marcotte CLA 2014-09-16 13:25:07 EDT
I tried with JDK 7u67 and it didn't improve a bit.

-vm 
C:/Program Files/Java/jdk1.7.0_67/bin/javaw.exe
Comment 12 Daniel Marcotte CLA 2014-09-18 10:15:59 EDT
Ok I set the JDK7u67 within Eclipse but not in my project's compilation. Once I did things get way faster!

Thank you for pointing me out to the right solution.

I guess the problem is solve, I didn't know the JDK older version could be so harmful... We run this version in Production, we better upgrade it soon!

Thank you for your supports guys!
Comment 13 Daniel Rolka CLA 2014-09-18 10:45:58 EDT
(In reply to Daniel Marcotte from comment #12)
> Ok I set the JDK7u67 within Eclipse but not in my project's compilation.
> Once I did things get way faster!
> 
> Thank you for pointing me out to the right solution.
> 
> I guess the problem is solve, I didn't know the JDK older version could be
> so harmful... We run this version in Production, we better upgrade it soon!
> 
> Thank you for your supports guys!

No problem. Anyway thanks for your attachments that will be very helpful during our work on performance tunning of Eclipse

Daniel
Comment 14 Lars Vogel CLA 2019-11-27 07:46:06 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.