Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318125 - [content assist] Unresponsive when opening content assist
Summary: [content assist] Unresponsive when opening content assist
Status: RESOLVED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Mylyn Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2010-06-27 09:59 EDT by masoodlodin CLA
Modified: 2010-07-27 17:34 EDT (History)
7 users (show)

See Also:


Attachments
thread dump using adaptj stacktrace (27.84 KB, text/plain)
2010-06-28 12:36 EDT, masoodlodin CLA
no flags Details
thread dump 2-a (24.40 KB, text/plain)
2010-07-01 05:18 EDT, masoodlodin CLA
no flags Details
thread dump 2-b (24.07 KB, text/plain)
2010-07-01 05:19 EDT, masoodlodin CLA
no flags Details
thread dump 2-c (25.14 KB, text/plain)
2010-07-01 05:19 EDT, masoodlodin CLA
no flags Details
thread dump 2-d (21.09 KB, text/plain)
2010-07-01 05:19 EDT, masoodlodin CLA
no flags Details
thread dump 3-a (22.87 KB, text/plain)
2010-07-01 05:20 EDT, masoodlodin CLA
no flags Details
thread dump 3-b (23.02 KB, text/plain)
2010-07-01 05:20 EDT, masoodlodin CLA
no flags Details
thread dump 3-c (22.52 KB, text/plain)
2010-07-01 05:20 EDT, masoodlodin CLA
no flags Details
thread dump 3-d (22.52 KB, text/plain)
2010-07-01 05:21 EDT, masoodlodin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description masoodlodin CLA 2010-06-27 09:59:37 EDT
Build Identifier: 20100617-1415

Sometimes but relatively often when I press "Crtl + Space" to open template proposals, eclipse becomes unresponsive for about 15 seconds.

This happens randomly, sometimes the template proposals pop up immediately, sometimes it hangs.

I do not have the problem using eclipse gallileo, so it must be some bug in helios.

Reproducible: Sometimes

Steps to Reproduce:
1. Enter some characters
2. Press "Crtl + Space" to open template proposals
3. sometimes eclipse will hang for about 15 seconds
Comment 1 Remy Suen CLA 2010-06-27 21:20:06 EDT
What kind of files are you editing? Java? C/C++? PHP? Something else?
Comment 2 masoodlodin CLA 2010-06-28 04:37:16 EDT
(In reply to comment #1)
> What kind of files are you editing? Java? C/C++? PHP? Something else?

Sorry, I forgot to mention that. I'm working on a Java project.
I could also offer you a video, if that would help you.
Comment 3 Prakash Rangaraj CLA 2010-06-28 04:39:59 EDT
(In reply to comment #2)
> Sorry, I forgot to mention that. I'm working on a Java project.

   Then this goes to JDT
Comment 4 Markus Keller CLA 2010-06-28 10:50:08 EDT
Out of the box, Ctrl+Space shows more than just Template proposals. Did you change the settings on the "Java > Editor > Content Assist > Advanced" preference page?

Could you take a stacktrace while Eclipse hangs? I suggest starting with eclipsec.exe and then pressing Ctrl+Break in the console window, or see http://wiki.eclipse.org/How_to_report_a_deadlock .
Comment 5 masoodlodin CLA 2010-06-28 12:36:36 EDT
Created attachment 172924 [details]
thread dump using adaptj stacktrace
Comment 6 masoodlodin CLA 2010-06-28 12:40:44 EDT
(In reply to comment #4)
> Out of the box, Ctrl+Space shows more than just Template proposals. Did you
> change the settings on the "Java > Editor > Content Assist > Advanced"
> preference page?
> 
> Could you take a stacktrace while Eclipse hangs? I suggest starting with
> eclipsec.exe and then pressing Ctrl+Break in the console window, or see
> http://wiki.eclipse.org/How_to_report_a_deadlock .

I did not change anything, just downloaded helios and wanted to give it a try.
Comment 7 Dani Megert CLA 2010-07-01 02:43:39 EDT
It looks like it is fetching the parameter names from Javadoc. This happens if there's no source attached. Is your Javadoc local or fetched from the internet?

On the other hand we apply a timeout of 50ms hence it shouldn't take that long. Can you verify that the timeout is indeed 50ms (Java > Editor > Content Assist > Advanced)?

Please attach some more screen dumps to confirm that it's indeed the parameter name reading that causes this.

>org.eclipse.jdt.internal.core.JavadocContents.getMethodDoc(JavadocContents.java:126)
>org.eclipse.jdt.internal.core.BinaryMethod.getParameterNames(BinaryMethod.java:254)
Moving to JDT Core for further investigation.
Comment 8 masoodlodin CLA 2010-07-01 05:18:31 EDT
Created attachment 173179 [details]
thread dump 2-a
Comment 9 masoodlodin CLA 2010-07-01 05:19:01 EDT
Created attachment 173180 [details]
thread dump 2-b
Comment 10 masoodlodin CLA 2010-07-01 05:19:25 EDT
Created attachment 173181 [details]
thread dump 2-c
Comment 11 masoodlodin CLA 2010-07-01 05:19:55 EDT
Created attachment 173182 [details]
thread dump 2-d
Comment 12 masoodlodin CLA 2010-07-01 05:20:21 EDT
Created attachment 173183 [details]
thread dump 3-a
Comment 13 masoodlodin CLA 2010-07-01 05:20:40 EDT
Created attachment 173184 [details]
thread dump 3-b
Comment 14 masoodlodin CLA 2010-07-01 05:20:59 EDT
Created attachment 173185 [details]
thread dump 3-c
Comment 15 masoodlodin CLA 2010-07-01 05:21:25 EDT
Created attachment 173186 [details]
thread dump 3-d
Comment 16 masoodlodin CLA 2010-07-01 05:26:08 EDT
(In reply to comment #7)
> It looks like it is fetching the parameter names from Javadoc. This happens if
> there's no source attached. Is your Javadoc local or fetched from the internet?
> 
> On the other hand we apply a timeout of 50ms hence it shouldn't take that long.
> Can you verify that the timeout is indeed 50ms (Java > Editor > Content Assist
> > Advanced)?
> 
> Please attach some more screen dumps to confirm that it's indeed the parameter
> name reading that causes this.
> 
> >org.eclipse.jdt.internal.core.JavadocContents.getMethodDoc(JavadocContents.java:126)
> >org.eclipse.jdt.internal.core.BinaryMethod.getParameterNames(BinaryMethod.java:254)
> Moving to JDT Core for further investigation.

- My javadoc is local.

- The timeout is set to 50ms.

- I've added a few more thread dumps. They are called 2a,2b,2c,2d because they were made during a single lock, but at different times. You can see, that the lock lasts more than a minute and not just 15seconds as I stated before.
Comment 17 Dani Megert CLA 2010-07-01 06:11:30 EDT
And Eclipse is configured to use that local copy?
Comment 18 masoodlodin CLA 2010-07-01 06:54:54 EDT
(In reply to comment #17)
> And Eclipse is configured to use that local copy?

The javadoc for the standard java library is fetched from http://java.sun.com/javase/6/docs/api/

But I'm using a few third party libraries with local javadoc sources.
- miglayout
- jgoodies
- jdom
- balloontip
Comment 19 Dani Megert CLA 2010-07-01 08:02:00 EDT
>The javadoc for the standard java library is fetched from
>http://java.sun.com/javase/6/docs/api/
That explains it. However, I'd expect the timeout preference to reduce the performance penalty. For now, either download the Javadoc or source and attach it to the JRE in Eclipse.
Comment 20 Srikanth Sankaran CLA 2010-07-01 09:17:10 EDT
Ayush, please follow up -- Thanks.
Comment 21 masoodlodin CLA 2010-07-01 10:38:27 EDT
(In reply to comment #19)
> >The javadoc for the standard java library is fetched from
> >http://java.sun.com/javase/6/docs/api/
> That explains it. However, I'd expect the timeout preference to reduce the
> performance penalty. For now, either download the Javadoc or source and attach
> it to the JRE in Eclipse.

I don't know where to set the javadoc location in eclipse globally. But I changed the javadoc location to "file:/C:/Program Files/Java/jdk1.6.0_18/docs/api/" for each jar individually.

The problem still exists.
Comment 22 Ayushman Jain CLA 2010-07-02 03:58:39 EDT
I think this is an inadvertent consequence of the fix for bug 293955. I'll investigate why using CharOperation.indexOf is getting stuck in some loop somewhere.
Comment 23 Ayushman Jain CLA 2010-07-02 06:30:44 EDT
I havent been able to reproduce the problem. Masoodlodin, can you please provide a testcase, so that I can investigate further? Thanks!
Comment 24 masoodlodin CLA 2010-07-02 08:21:06 EDT
(In reply to comment #23)
> I havent been able to reproduce the problem. Masoodlodin, can you please
> provide a testcase, so that I can investigate further? Thanks!

I'm not sure how I can help you. I don't know what you need to do to reproduce the bug, I'm not doing anything special.

However, I can provide you a video of the bug. I don't know if it's helpful though.

http://www.otti.at/eclipse/eclipse.swf.html
Comment 25 masoodlodin CLA 2010-07-05 06:04:18 EDT
Any new info on this? I just tried the linux version of eclipse - same problem in helios. No problem in galileo.
Comment 26 Markus Keller CLA 2010-07-05 07:09:20 EDT
Masoodlodin, since we cannot reproduce this issue, it must rely on something special in your workspace. It could be as small as a missing character in the generated Javadoc that you attached to a project. The problem is that we have no way to find the culprit without access to your workspace.

Can you reproduce the problem consistently when you press Ctrl+Space at a certain position in you source file? If yes, then please try to isolate the problem and provide steps to reproduce in a fresh workspace. E.g. remove dependent libraries, Javadoc attachments, etc. one-by-one until the problem does not occur any more.

You could also try to debug this yourself. Create a second workspace, create an Eclipse Application debug configuration, and set the workspace location to the workspace in which you can reproduce the problem. Then debug, invoke content assist, and suspend the main thread while eclipse hangs. Then try to find out more about the context in the Variables view.
Comment 27 masoodlodin CLA 2010-07-05 07:37:19 EDT
You seem to be right. I just created a second workspace with a new java project and everything worked fine. No lags, no locks, the window just pops up immediately. I always tested it on the project I am currently working on. Never thought of trying it with a new project.

However it has to be a bug introduced in helios, since I have no problems in galileo. I made a zip archive of my workspace including the project source, where the problem occurs. You can download it from 

http://www.otti.at/eclipse/workspace.zip
Comment 28 Ayushman Jain CLA 2010-07-06 02:09:49 EDT
(In reply to comment #27)
> You seem to be right. I just created a second workspace with a new java project
> and everything worked fine. No lags, no locks, the window just pops up
> immediately. I always tested it on the project I am currently working on. Never
> thought of trying it with a new project.
> 
> However it has to be a bug introduced in helios, since I have no problems in
> galileo. I made a zip archive of my workspace including the project source,
> where the problem occurs. You can download it from 
> 
> http://www.otti.at/eclipse/workspace.zip

Thanks Masood for your efforts in trying to reproduce the bug. As you mentioned, you couldnt reproduce the problem in a fresh workspace that you set up, I guess the previous workspace might have got something accidentally mangled or something. Even I couldnt reproduce the bug. Everything seems to be fine with the code in CharOperation where you were earlier getting locked up. Since this seems to be a workspace specific issue which is also resolved for you now, I intend to close as WORKSFORME.
Comment 29 Dani Megert CLA 2010-07-06 02:12:28 EDT
Masood, can your reproduce the bug using http://www.otti.at/eclipse/workspace.zip plus R3.6 from here:
http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/index.php
?
Comment 30 Ayushman Jain CLA 2010-07-06 04:17:20 EDT
(In reply to comment #29)
> Masood, can your reproduce the bug using
> http://www.otti.at/eclipse/workspace.zip plus R3.6 from here:
> http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/index.php
> ?

I tried. But couldnt reproduce.
Comment 31 masoodlodin CLA 2010-07-06 05:24:18 EDT
(In reply to comment #29)
> Masood, can your reproduce the bug using
> http://www.otti.at/eclipse/workspace.zip plus R3.6 from here:
> http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/index.php
> ?

Yes, same problem.

I tried something else: 

I created a new project and copied over the src folder from the Visualization folder. Then I imported the jar files again and everything worked fine. So the problem cannot be the source or the jar files.

I don't know what is causing the problem, but maybe we should just close this bug since it seems to be specific to a single project.

Thank you all for your assistance. Eclipse is a great product :)
Comment 32 Srikanth Sankaran CLA 2010-07-07 01:31:23 EDT
(In reply to comment #31)
> (In reply to comment #29)
> > Masood, can your reproduce the bug using
> > http://www.otti.at/eclipse/workspace.zip plus R3.6 from here:
> > http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/index.php
> > ?
> 
> Yes, same problem.

> I don't know what is causing the problem, but maybe we should just close this
> bug since it seems to be specific to a single project.

Jay, Masood is able to reproduce this with 

http://www.otti.at/eclipse/workspace.zip plus R3.6 from here:
http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/index.php

while Ayush is not. 

Before we close this bug per Masood's suggestion, could you give it one
more shot and see if you are able to see the problem ? Thanks.
Comment 33 Jay Arthanareeswaran CLA 2010-07-07 02:35:15 EDT
(In reply to comment #32)
> Jay, Masood is able to reproduce this with 
> 
> http://www.otti.at/eclipse/workspace.zip plus R3.6 from here:
> http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/index.php
> 
> while Ayush is not. 
> 
> Before we close this bug per Masood's suggestion, could you give it one
> more shot and see if you are able to see the problem ? Thanks.

I am not able to reproduce the problem with eclipse version R-3.6-201006080911 and the given workspace.
Comment 34 Markus Keller CLA 2010-07-07 06:33:04 EDT
I'm moving this bug to Mylyn. The workspace from comment 27 contains mylyn data, and when I do Ctrl+Space the first time with a plain 3.6 SDK, I get a dialog telling me that the default content assist provider has been disabled.

See comment 24 for a movie that shows the problem.
Comment 35 Steffen Pingel CLA 2010-07-27 17:34:26 EDT
None of the attached thread dumps how any trace of Mylyn and the Task List in the workspace is empty. The Task-Focused Proposal computer will simply delegate to the default implementation and I am not able to reproduce the problem.

masoodlodin@hotmail.com, please try increasing the amount of heap and permgen memory to rule out problems related to memory thrashing.