Community
Participate
Working Groups
One of our users has reported frequent UI freezes of up to a minute with the following stack trace (attached below). Looking through the code in question... org.eclipse.jdt.internal.core.NameLookup.findAllTypes(NameLookup.java:328) This seems to be doing an exhaustive search over all the packages. org.eclipse.jdt.internal.core.NameLookup.seekTypesInBinaryPackage(NameLookup.java:1085) That's doing an exhaustive search over all the class files in each package. org.eclipse.jdt.internal.core.ClassFile.getBinaryTypeInfo(ClassFile.java:284) at That's opening each class file and unpacking some data from it. The consequence is that JDT is exhaustively reading every single .class file in the project, in the UI thread. I also don't see it accessing the index at any point in that call chain. Is there any way we can do any of the following? - Speed this up - Move it to a background thread - Terminate the prefix search early if it takes excessively long and just skip offering suggestions. at java.util.zip.ZipFile.close(Native Method) at java.util.zip.ZipFile.close(ZipFile.java:648) at org.eclipse.jdt.internal.core.JavaModelManager.closeZipFile(JavaModelManager.java:1669) at org.eclipse.jdt.internal.core.ClassFile.getJarBinaryTypeInfo(ClassFile.java:376) at org.eclipse.jdt.internal.core.ClassFile.getBinaryTypeInfo(ClassFile.java:290) at org.eclipse.jdt.internal.core.ClassFile.getBinaryTypeInfo(ClassFile.java:284) at org.eclipse.jdt.internal.core.ClassFile.buildStructure(ClassFile.java:93) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:259) at org.eclipse.jdt.internal.core.SourceRefElement.generateInfos(SourceRefElement.java:107) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:579) at org.eclipse.jdt.internal.core.BinaryType.getElementInfo(BinaryType.java:287) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:302) at org.eclipse.jdt.internal.core.BinaryType.getFlags(BinaryType.java:319) at org.eclipse.jdt.internal.core.SearchableEnvironmentRequestor.acceptType(SearchableEnvironmentRequestor.java:115) at org.eclipse.jdt.internal.core.NameLookup.seekTypesInBinaryPackage(NameLookup.java:1085) at org.eclipse.jdt.internal.core.NameLookup.seekTypes(NameLookup.java:1019) at org.eclipse.jdt.internal.core.NameLookup.seekTypes(NameLookup.java:962) at org.eclipse.jdt.internal.core.NameLookup.findAllTypes(NameLookup.java:328) at org.eclipse.jdt.internal.core.NameLookup.seekTypes(NameLookup.java:995) at org.eclipse.jdt.internal.core.NameLookup.seekTypes(NameLookup.java:962) at org.eclipse.jdt.internal.core.SearchableEnvironment.findTypes(SearchableEnvironment.java:641) at org.eclipse.jdt.internal.core.SearchableEnvironment.findTypes(SearchableEnvironment.java:474) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findTypesAndPackages(CompletionEngine.java:10707) at org.eclipse.jdt.internal.codeassist.CompletionEngine.completionOnSingleNameReference(CompletionEngine.java:3306) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1713) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1939) at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:131) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:357) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:351) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:339) at org.eclipse.jdt.internal.ui.text.correction.SimilarElementsRequestor.process(SimilarElementsRequestor.java:143) at org.eclipse.jdt.internal.ui.text.correction.SimilarElementsRequestor.findSimilarElement(SimilarElementsRequestor.java:90) at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor.addSimilarTypeProposals(UnresolvedElementsSubProcessor.java:756) at org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor.getVariableProposals(UnresolvedElementsSubProcessor.java:274) at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.process(QuickFixProcessor.java:361) at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.getCorrections(QuickFixProcessor.java:316) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionCollector.safeRun(JavaCorrectionProcessor.java:378) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.run(JavaCorrectionProcessor.java:339) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.process(JavaCorrectionProcessor.java:335) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectCorrections(JavaCorrectionProcessor.java:468) at org.eclipse.jdt.internal.ui.text.java.hover.ProblemHover$ProblemInfo.getJavaAnnotationFixes(ProblemHover.java:225) at org.eclipse.jdt.internal.ui.text.java.hover.ProblemHover$ProblemInfo.getCompletionProposals(ProblemHover.java:199) at org.eclipse.jdt.internal.ui.text.java.hover.AbstractAnnotationHover$AnnotationInformationControl.deferredCreateContent(AbstractAnnotationHover.java:285) at org.eclipse.jdt.internal.ui.text.java.hover.AbstractAnnotationHover$AnnotationInformationControl.setInput(AbstractAnnotationHover.java:186) at org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(AbstractInformationControlManager.java:1181) at org.eclipse.jface.text.AbstractInformationControlManager.presentInformation(AbstractInformationControlManager.java:1150) at org.eclipse.jface.text.AbstractHoverInformationControlManager.presentInformation(AbstractHoverInformationControlManager.java:902) at org.eclipse.jface.text.TextViewerHoverManager.doPresentInformation(TextViewerHoverManager.java:243) at org.eclipse.jface.text.TextViewerHoverManager$5.run(TextViewerHoverManager.java:233)
Possibly related to bug 414324 and bug 371555.
Manoj, please advise what we want to do here.
(In reply to Jay Arthanareeswaran from comment #2) > Manoj, please advise what we want to do here. Looking through the suggestions - speedup is something which we(jdt.core) can look into (and may be a little long term) but the suggestion of spawning another thread from ui for this may be an immediate option. Noopur : is there any blocker for doing this from jdt.ui?
(In reply to Manoj Palat from comment #3) > (In reply to Jay Arthanareeswaran from comment #2) > > Manoj, please advise what we want to do here. > Looking through the suggestions - speedup is something which we(jdt.core) > can look into (and may be a little long term) but the suggestion of spawning > another thread from ui for this may be an immediate option. Noopur : is > there any blocker for doing this from jdt.ui? We had a discussion about it in jdt.ui call. In this case, the jdt.core api is called when the quick fix is invoked (See stacktrace: org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.process(QuickFixProcessor.java:361)). Moving the call to a background thread is not a good solution in case of the quick fix and may also result in sync issues.
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.