Bug 522091 - High CPU use in hover and/or code recommenders
Summary: High CPU use in hover and/or code recommenders
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows NT
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-09 14:51 EDT by John Hendrikx CLA
Modified: 2020-05-09 07:46 EDT (History)
1 user (show)

See Also:


Attachments
Thread dump 1 (27.61 KB, text/plain)
2017-09-09 14:51 EDT, John Hendrikx CLA
no flags Details
Thread dump 2 (27.03 KB, text/plain)
2017-09-09 14:52 EDT, John Hendrikx CLA
no flags Details
Thread dump 3 (27.04 KB, text/plain)
2017-09-09 14:52 EDT, John Hendrikx CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Hendrikx CLA 2017-09-09 14:51:37 EDT
Created attachment 270134 [details]
Thread dump 1

Today Eclipse started using high CPU while working on an enum class that also used some Lambda's as parameters.  Two threads seem to be looping (50% CPU use on a 4 core machine).  This has been happening 30+ minutes already, I'll need to restart Eclipse to fix it.

I made a few Jstack dumps, which I've attached.

The culprit seem to be two RUNNABLE Threads: "Text Viewer Hover Presenter" and "Recommenders-Timeout-Manager".
Comment 1 John Hendrikx CLA 2017-09-09 14:52:01 EDT
Created attachment 270135 [details]
Thread dump 2
Comment 2 John Hendrikx CLA 2017-09-09 14:52:15 EDT
Created attachment 270136 [details]
Thread dump 3
Comment 3 Eclipse Genie CLA 2020-05-08 12:33:52 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.
Comment 4 Stephan Herrmann CLA 2020-05-09 07:46:17 EDT
Yep, this code area:

"Text Viewer Hover Presenter" #2552 daemon prio=1 os_prio=-2 tid=0x000000001ea41800 nid=0x1f00 runnable [0x000000007d11e000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.jdt.internal.codeassist.impl.AssistParser.copyState(AssistParser.java:138)
	at org.eclipse.jdt.internal.codeassist.impl.AssistParser.fallBackToSpringForward(AssistParser.java:2205)
	at org.eclipse.jdt.internal.codeassist.impl.AssistParser.resumeAfterRecovery(AssistParser.java:2225)
	at org.eclipse.jdt.internal.codeassist.select.SelectionParser.resumeAfterRecovery(SelectionParser.java:1541)
	at org.eclipse.jdt.internal.compiler.parser.Parser.resumeOnSyntaxError(Parser.java:12971)

is known to be incomplete / buggy concerning completion. Apparently, also selection is affected.

It's all due to irregularities in the Java grammar, which need lots of workarounds to squeeze it into a grammar that the parser generator jikespg accepts. These workarounds then conflict with the highly sophisticated machinery of syntax recovery. We haven't yet found a strategy to improve the situation.

We have open bugs concerning completion, which should be sufficient to remind us of the problem.