Bug 293856 - [Browser] "Computing additional info" lag during content assist executions
Summary: [Browser] "Computing additional info" lag during content assist executions
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5.1   Edit
Hardware: PC Linux
: P3 major with 7 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2009-10-31 16:37 EDT by Skel CLA
Modified: 2019-04-23 08:47 EDT (History)
12 users (show)

See Also:


Attachments
Part of stack dump. (24.81 KB, text/plain)
2009-11-02 23:13 EST, Skel CLA
no flags Details
Thread dump when Eclipse froze during content assist (14.81 KB, text/plain)
2009-11-09 20:05 EST, Danny Kutner CLA
no flags Details
Thread dump when Eclipse froze after hovering over object (14.69 KB, text/plain)
2009-11-09 20:09 EST, Danny Kutner CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Skel CLA 2009-10-31 16:37:26 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4
Build Identifier:  M20090917-0800

When using Java Editor, if content assist is accessed, frequent "Computing additional info" tasks (3-6 on average for me) appear in the progress bar.  Clicking on the progress icon opens the Progress view to display them.  The lag lasts on average 10-30 seconds and regularly spikes the CPU usage to 100%.  

System:
 - 64 bit Windows 7, Intel Core 2 Duo CPU, 2.33 GHz, 4 GB RAM
 - 32 bit Eclipse/SDK & 64 bit Eclipse/SDK (tried both, same problem found)
 - Eclipse Classic 3.5.1 with Web Tools Platform

Generally nothing else can be done until the tasks finish, especially if additional content assist executions are needed.  It is severely disruptive to development.  Did not see the problem on Windows XP.

Reproducible: Sometimes

Steps to Reproduce:
1. Edit a .java File with Java Editor (Eclipse Default)
2. Activate content assist on an object
3. "Computing additional info" appears in bottom-right of screen in the progress bar.
Comment 1 Dani Megert CLA 2009-11-02 04:23:04 EST
>Generally nothing else can be done until the tasks finish,
Is the UI blocked? The additional info is computed in a separate thread and hence should not block the UI.

> especially if additional content assist executions are needed. 
Not sure what you mean here.

The reason why you now notice this on the Windows 7 installation might be that your JRE does not have source attached and hence tries to fetch it from the internet. If your connection is slow then it takes longer to fetch the info and when you scroll down in the completion proposal popup it starts to fetch again while the other job is still running.
Comment 2 Skel CLA 2009-11-02 10:34:01 EST
(In reply to comment #1)
> >Generally nothing else can be done until the tasks finish,
> Is the UI blocked? The additional info is computed in a separate thread and
> hence should not block the UI.

No, the UI is not physically blocked.  It is only "disabled" by the mere fact the CPU usage is spiked at 100% and everything basically freezes while computing additional info tasks dominate.  If you try to do anything, Eclipse will show the "Not Responding" message at the top until these tasks finish.

> > especially if additional content assist executions are needed. 
> Not sure what you mean here.

By this I mean objects within objects.  You may need to do content assist a couple of times to drill down to the method or object needed.

> The reason why you now notice this on the Windows 7 installation might be that
> your JRE does not have source attached and hence tries to fetch it from the
> internet. 

I thought the source was always attached to JDK's.  I confirmed the source is definitely not attached.  Is there a download/install which includes it?  Didn't see anything on Java.sun this morning.  Not sure how to easily remedy this.

> If your connection is slow then it takes longer to fetch the info and
> when you scroll down in the completion proposal popup it starts to fetch again
> while the other job is still running.

My connection is extremely fast (High-Speed Xtreme with Shaw Cable).
Comment 3 Dani Megert CLA 2009-11-02 10:56:13 EST
>No, the UI is not physically blocked.  It is only "disabled" by the mere fact
>the CPU usage is spiked at 100%
I suspect it's not the additional info that slows you down but rather that code assist extracts the parameter names from Javadoc. Try whether reducing the timeout on Java > Editor > Content Assist > Advanced helps.

>I thought the source was always attached to JDK's. 
It depends what you install: if you install a Java SDK which has source included then Eclipse attaches it. I guss you have installed just a JRE.
Comment 4 Skel CLA 2009-11-02 11:23:49 EST
(In reply to comment #3)
> >No, the UI is not physically blocked.  It is only "disabled" by the mere fact
> >the CPU usage is spiked at 100%
> I suspect it's not the additional info that slows you down but rather that code
> assist extracts the parameter names from Javadoc. Try whether reducing the
> timeout on Java > Editor > Content Assist > Advanced helps.

Timeout was set to 50 ms.  Lowered.  No effect.

> >I thought the source was always attached to JDK's. 
> It depends what you install: if you install a Java SDK which has source
> included then Eclipse attaches it. I guss you have installed just a JRE.

I definitely had the SDK installed, but my Eclipse was pointing at a folder with only JRE installed.  Switched "Installed JREs" to point at correct folder, source is now working.  Restarted Eclipse.  "Computing additional info" tasks and lag unaffected.  :(  I watched each task more closely this time and each one is taking 5-10 seconds to complete processing.  Never seems to be less than 3 or more than 6.

I totally thought attaching source was going to fix it!!  Thanks for your help so far.  It is really really really appreciated.
Comment 5 Dani Megert CLA 2009-11-02 11:31:51 EST
Try to make some stack dumps while this happens.
Comment 6 Skel CLA 2009-11-02 12:34:09 EST
(In reply to comment #5)
> Try to make some stack dumps while this happens.

I'll work on it.  I re-booted with JVM pointing at java in eclipse.ini (to get the console window).  Will see what I can do.

I may have accidentally stumbled on the source of the problem.  When I re-pointed the JVM at a new folder, it prompted me with this:
http://maximumpcguides.com/windows-7/wp-content/uploads/2009/07/allow-program-windows-7-firewall-7-468x334.PNG

I didn't select the public networks option the first time which I believe gives Java access to the internet.  May have been the source of the problems all along, although if this IS the source of the problem, the timeout seems to not be working properly when there is no internet access for Java.  Will continue testing through the day and see if problem is solved or report any new findings.
Comment 7 Skel CLA 2009-11-02 22:31:41 EST
(In reply to comment #6)

I was wrong.  Firewall had no effect.  Turned it off completely and the lag was the same.

I added the -consoleLog option to Eclipse at startup.  Was able to do a stack dump but I was not able to capture it in any way.  Seems Windows 7 disables any interaction with the console and the stack dump doesn't seem to write to the file system anywhere I could find (searched all .log files in my Workspace and could find no trace of it).

Any help would be appreciated as to how to capture the stack trace (too big for screen capture) so I can attach it here.
Comment 8 Olivier Thomann CLA 2009-11-02 22:49:53 EST
Unfortunately I don't have access to a Windows 7 machine.
You might want to have a look in the folder where the eclipse.exe is or where the java.exe is.
Comment 9 Skel CLA 2009-11-02 23:13:35 EST
Created attachment 151151 [details]
Part of stack dump.

Couldn't find the entire stack dump, but managed to capture a portion of it.  Hopefully it is a useful start to help debug the lag.
Comment 10 Skel CLA 2009-11-02 23:42:59 EST
(In reply to comment #9)

Eclipse startup details (using -debug):

Start VM: -Xms40m
-Xmx256m
-XX:MaxPermSize=256m
-Djava.class.path=C:\Program Files\eclipse\plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-os win32
-ws win32
-arch x86
-showsplash C:\Program Files\eclipse\\plugins\org.eclipse.platform_3.3.201.v200909170800\splash.bmp
-launcher C:\Program Files\eclipse\eclipse.exe
-name Eclipse
--launcher.library C:\Program Files\eclipse\plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519\eclipse_1206.dll
-startup C:\Program Files\eclipse\plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-consoleLog
-debug
-vm C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
-vmargs
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
-Djava.class.path=C:\Program Files\eclipse\plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
Install location:
    file:/c:/Program Files/eclipse/
Configuration file:
    file:/c:/Program Files/eclipse/configuration/config.ini loaded
Configuration location:
    file:/c:/Program Files/eclipse/configuration/
Framework located:
    file:/c:/Program Files/eclipse/plugins/org.eclipse.osgi_3.5.1.R35x_v20090827.jar
Framework classpath:
    file:/c:/Program Files/eclipse/plugins/org.eclipse.osgi_3.5.1.R35x_v20090827.jar
Splash location:
    C:\Program Files\eclipse\\plugins\org.eclipse.platform_3.3.201.v200909170800\splash.bmp
Debug options:
    file:/C:/Program Files/eclipse/.options not found
Time to load bundles: 7
Starting application: 933
Application Started: 10824
Comment 11 Skel CLA 2009-11-03 00:52:39 EST
(In reply to comment #10)

Downloaded Eclipse 3.4.2 - Build id:  M20090211-1700

Enabled Content Assist - "Other Java Proposals"

No lag at all.  Works great.  Doesn't even appear to have the "Computing additional info" tasks.  Looks like I may have to downgrade for now until the problem is resolved with 3.5.1.
Comment 12 Dani Megert CLA 2009-11-03 05:39:01 EST
You need to use ecplisec.exe if you want the console to be connected.


>Downloaded Eclipse 3.4.2 - Build id:  M20090211-1700
>
>Enabled Content Assist - "Other Java Proposals"
Can you retry with a plain Eclipse SDK 3.5.1 (not a package that has Mylyn and other stuff in it)?
Comment 13 Skel CLA 2009-11-04 01:03:23 EST
(In reply to comment #12)
> Can you retry with a plain Eclipse SDK 3.5.1 (not a package that has Mylyn and
> other stuff in it)?

I downloaded Platform Runtime Binary (eclipse-platform-3.5.1-win32.zip) and JDT SDK (eclipse-JDT-SDK-3.5.1.zip).  Same problem exists.
Comment 14 Dani Megert CLA 2009-11-04 02:19:54 EST
>I downloaded Platform Runtime Binary (eclipse-platform-3.5.1-win32.zip) and JDT
>SDK (eclipse-JDT-SDK-3.5.1.zip).
But did you try on just that or did you add other bundles? Note that there's a single build which contains the SDK:
http://download.eclipse.org/eclipse/downloads/drops/R-3.5.1-200909170800/index.php

Can you also try it with above build plus a new workspace?
Comment 15 Danny Kutner CLA 2009-11-09 18:58:34 EST
I believe I am having the same problem. In addition to Eclipse freezing when using content assist, it seems to free when I hover over an object or method. I am running Eclipse 3.5.1 (build ID 20090920-1017) on Windows XP, but I have tried Eclipse 3.3 as well, and the problem exists on both. The problem only occurs when I am connected to the internet. I also tried Ubuntu on the same computer to make sure it wasn't a hardware problem, and Eclipse never froze.
Comment 16 Olivier Thomann CLA 2009-11-09 19:16:00 EST
If you could extract a test case, that would be great. Are you using plain Eclipse or you also installed some other bundles like WebTools, ...?
Any firewall issues ? Are you using a proxy ? Where is the javadoc of the element you are hovering over located ?
Comment 17 Olivier Thomann CLA 2009-11-09 19:17:34 EST
(In reply to comment #15)
> am running Eclipse 3.5.1 (build ID 20090920-1017) on Windows XP, but I have
> tried Eclipse 3.3 as well, and the problem exists on both. The problem only
Danny, if you could provide a thread dump, that would definitely help.
Comment 18 Danny Kutner CLA 2009-11-09 20:03:53 EST
(In reply to comment #16)
> If you could extract a test case, that would be great.
What do you mean by this?

>Are you using plain Eclipse or you also installed some other bundles like WebTools, ...?
I'm just using plain Eclipse.

> Any firewall issues ? Are you using a proxy ?
I've disabled the firewall, and I still have the issue. I'm not using a proxy.

>Where is the javadoc of the element you are hovering over located ?
I've tried using the default javadoc at http://java.sun.com/javase/6/docs/api/ and downloading the javadoc. Eclipse freezes either way.
Comment 19 Danny Kutner CLA 2009-11-09 20:05:19 EST
Created attachment 151762 [details]
Thread dump when Eclipse froze during content assist
Comment 20 Danny Kutner CLA 2009-11-09 20:09:17 EST
Created attachment 151763 [details]
Thread dump when Eclipse froze after hovering over object
Comment 21 Skel CLA 2009-11-09 23:26:37 EST
(In reply to comment #14)
> >I downloaded Platform Runtime Binary (eclipse-platform-3.5.1-win32.zip) and JDT
> >SDK (eclipse-JDT-SDK-3.5.1.zip).
> But did you try on just that or did you add other bundles? Note that there's a
> single build which contains the SDK:
> http://download.eclipse.org/eclipse/downloads/drops/R-3.5.1-200909170800/index.php

Oops lol!  I didn't add any other bundles. 
 
> Can you also try it with above build plus a new workspace?

Tried it with a brand new workspace right after fresh install.  Same problem.


I've been working with 3.4.2 (Build id: M20090211-1700) with web tools, sql explorer, and tomcat 5.5 server plugins with absolutely no problem for a week now.

3.5.1 really needs an option to disable this "Computing additional info" thingy. :/
Comment 22 Dani Megert CLA 2009-11-10 06:31:13 EST
The thread dumps help and explain both issue: it looks like it hangs when trying to set the text in the SWT Browser widget:

"main" prio=6 tid=0x00a56800 nid=0xc8c runnable [0x0013e000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
	at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
	at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:487)
	at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:450)
	at org.eclipse.swt.browser.IE.setText(IE.java:956)
	at org.eclipse.swt.browser.Browser.setText(Browser.java:949)


Moving to SWT for comments.
Comment 23 Joel D'sa CLA 2009-11-25 18:44:47 EST
(In reply to comment #22)
> The thread dumps help and explain both issue: it looks like it hangs when
> trying to set the text in the SWT Browser widget:
> 
> "main" prio=6 tid=0x00a56800 nid=0xc8c runnable [0x0013e000]
>    java.lang.Thread.State: RUNNABLE
>     at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
>     at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
>     at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:487)
>     at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:450)
>     at org.eclipse.swt.browser.IE.setText(IE.java:956)
>     at org.eclipse.swt.browser.Browser.setText(Browser.java:949)
> 
> 
> Moving to SWT for comments.

I see this problem on linux as well. 64 bit JRE.
Comment 24 Pieter de Goeje CLA 2009-12-11 07:03:47 EST
I'm observing this on Linux 64bit w/ JDK6 and eclipse 3.5.1. The whole UI sometimes freezes for up to 15 seconds when typing a dot to get the list of class methods.
Comment 25 Ivo CLA 2010-01-25 08:37:13 EST
I've had this problem for the last few days. Using JConsole with JTop, I've determined the cause is some bug in reading/parsing large files. I had an autogenerated .java file around 3.5 MB in size, with many inner classes, and the hickups always happened after attempting context completion on classes in these files. Forcing the Axis2 wsdl2java tool to unpack the classes resolved the issue, as the largest generated source file is now ten times smaller.
Comment 26 Soichi Hayashi CLA 2010-01-27 13:10:47 EST
This happens daily on my machine. Latitude d830 / Core2 Duo 2.2GHz / 2G RAM / WinXP. The condition usually last like 10 - 15 minutes, and my PC becomes completely unresponsive while it's happening - even the mouse cursor freezes occasionally.
Comment 27 Soichi Hayashi CLA 2010-01-27 13:22:02 EST
I just noticed that when I open the background task view, I see bunch of "Computing additional info" items listed in the queue (like 5 sometimes, several dozens some other times), and I am wondering if this problem occurs not because "Computing additional info" itself has a problem, but it somehow spawns too many of them simultaneously..

I just thought that this information might help someone to fix this problem.
Comment 28 venugopal CLA 2010-04-06 05:39:44 EDT
I am using eclipse for writing web service clients. The problem exists on Ubuntu Linux 9.10 also. Machine config - 3GB RAM and dual core intel. It really brings everything to a standstill. Initially it stalls for around 30 secs and then complete eats away the CPU. Neither eclipse, nor other programs can be run. With no hope on the latest eclipse, I am going to give a try with Eclipse Europa 3.3. This bug totally makes eclipse unusable for me.
Comment 29 Grant Gayed CLA 2010-05-27 15:19:51 EDT
Reviewing the comments, this bug contains multiple issues:

1. original reporter:
- happens on Windows in eclipse 3.5.1, works in eclipse 3.4.2
- "3-6 Computing additional info tasks appear in the progress bar"
- 100% CPU

2. comment 15:
- happens on Windows in eclipse 3.5.1 AND at least as far back as 3.3
- trace shows hang in Browser.setText()
- only happens when connected to internet
- not stated, but presumably 0% CPU if waiting on a lock

3. in various other comments:
- happens on linux-gtk (one comment specified eclipse 3.5.1)
- comment 27: "I see [5 - dozens] "Computing additional info" items listed in the queue"

#1 and #3 above appear to be the same problem showing up on different platforms, and #2 is a different problem.  This report should deal with #1/#3.  I've created bug 314756 for #2.

For #1/#3: The descriptions of excessive numbers of tasks, and their appearance across multiple platforms, suggests that this is happening in JDT, so moving report.  In the meantime, it would be helpful if someone that is able to reproduce this easily in eclipse 3.5.1 could try with a recent eclipse 3.6 build like http://download.eclipse.org/eclipse/downloads/drops/S-3.6RC2-201005201744/index.php .
Comment 30 Olivier Thomann CLA 2010-05-27 17:17:25 EDT
Do you also get it with only Eclipse SDK without Web Tools?
I don't find any strings as "Computing additional info" in JDT.
Comment 31 Dani Megert CLA 2010-05-28 02:14:00 EDT
>3. in various other comments:
>- happens on linux-gtk (one comment specified eclipse 3.5.1)
>- comment 27: "I see [5 - dozens] "Computing additional info" items listed in
>the queue"
Most of the comments are Windows related and they definitely boil down bug 314756. Those who mention Linux are just wrong, e.g.:

(In reply to comment #22)
> The thread dumps help and explain both issue: it looks like it hangs when
> trying to set the text in the SWT Browser widget:
> 
>> "main" prio=6 tid=0x00a56800 nid=0xc8c runnable [0x0013e000]
>>    java.lang.Thread.State: RUNNABLE
>>     at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
>>     at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
>>     at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:487)
>>     at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:450)
>>     at org.eclipse.swt.browser.IE.setText(IE.java:956)
>>     at org.eclipse.swt.browser.Browser.setText(Browser.java:949)
>> 
>> 
>> Moving to SWT for comments.
>I see this problem on linux as well. 64 bit JRE.

It would be very very surprising to see Wind32 OS calls on Linux.

So: those who claim to see this on Linux please provide stack dumps, otherwise there's not much we can do here.
Comment 32 Eclipse Genie CLA 2019-04-21 03:12:06 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.

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.

--
The automated Eclipse Genie.