Community
Participate
Working Groups
I recently noticed a slowdown in the Java editor when selecting text with the mouse. In certain intervals (about 2 seconds), the drawn selection would stay in place and after a noticeable delay, would resume following the mouse. It also resulted in some CPU spikes when it happened. When taking stack traces while this happened, the only thing that caught my eye was the following (the top of the trace varied of course, but JavaSelectionProvider was always part of it): "Recommenders-Timeout-Manager" prio=10 tid=0x00007f1a870cd000 nid=0x2524 runnable [0x00007f1a5cd70000] java.lang.Thread.State: RUNNABLE at org.eclipse.jdt.internal.compiler.lookup.Scope.minimalErasedCandidates(Scope.java:3544) at org.eclipse.jdt.internal.compiler.lookup.Scope.hasErasedCandidatesCollisions(Scope.java:2965) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.checkParameterizedSuperTypeCollisions(ClassScope.java:751) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.checkParameterizedTypes(CompilationUnitScope.java:221) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:278) at org.eclipse.jdt.internal.codeassist.impl.Engine.accept(Engine.java:99) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:163) at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:197) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:438) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleImport(CompilationUnitScope.java:492) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports(CompilationUnitScope.java:373) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:417) at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:924) at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:162) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:377) at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:371) at org.eclipse.recommenders.internal.rcp.providers.JavaSelectionUtils.resolveJavaElementFromTypeRootInEditor(JavaSelectionUtils.java:147) at org.eclipse.recommenders.internal.rcp.providers.JavaSelectionUtils.resolveJavaElementFromEditor(JavaSelectionUtils.java:129) at org.eclipse.recommenders.internal.rcp.providers.JavaSelectionUtils.resolveJavaElementFromEditor(JavaSelectionUtils.java:112) at org.eclipse.recommenders.internal.rcp.providers.JavaSelectionProvider.handleSelectionInEditor(JavaSelectionProvider.java:108) at org.eclipse.recommenders.internal.rcp.providers.JavaSelectionProvider.access$1(JavaSelectionProvider.java:105) at org.eclipse.recommenders.internal.rcp.providers.JavaSelectionProvider$1.run(JavaSelectionProvider.java:82) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) I don't know why that would slow down the selection though. After restarting Eclipse, I could no longer reproduce the problem. I realize this is kind of an open bug report, but maybe you have an idea where the problem could be. Eclipse 4.3 (Kepler) Code Recommenders Developer Tools 1.0.4.v20130612-1006-b77
I'm not yet able to reproduce with 4.3 and recommenders 1.100.0 (there are no changes to Extdoc) Does this happen when the Extdoc view is open (only)? May I ask for a screencast showing the freeze or can you provide more information that allows me to reproduce this issue?
I don't know the Extdoc view, so unless it's somehow open in the background, I don't think it's caused by it. Should JavaSelectionProvider only be active when the Extdoc view is used? I'm not yet able to reproduce it after having restarted, I'll watch out for it and report back when it happens again.
Closing as "works for me". We'd be more than happy to fix this if the selection provider is the cause for the delays you experience.