Community
Participate
Working Groups
I20070323-1616 - org.eclipse.core.expressions and org.eclipse.core.expressions.tests from CVS - close o.e.c.e.tests - search for references to type ExpressionInfo in Workspace => 41 refs - open o.e.c.e.tests - in Search view, press F5 (context menu > Search Again) => still 41 refs => expected: all 87 refs
The problem is probably that JavaWorkspaceScope caches all projects from the workspace and does not refresh after it has been created. In my workspace, such a workspace scope object uses about 65K memory. If IJavaSearchScopes are considered heavyweight and become invalid when the workspace changes, this should be documented and clients should be asked not to store such objects (cf. Javadoc of ASTParser.setResolveBindings(boolean): "So it is very important to not retain any of these objects longer than absolutely necessary"). Moving to core for comments.
The caching is a memory problem for clients like Java search, whose ElementQuerySpecification holds on to IJavaSearchScope for a long time.
While searching for references on workspace using the menu item, this is not a JavaWorkspaceScope which is used to perform the request but a JavaSearchScope instead as the JRE is excluded from the scope in this use case... This explain the observed behavior as the scope is not rebuild while using Search -> Again item but uses the one stored in QuerySpecification object. It works as expected if I launch the same search using the Java Search dialog page including the JRE: I get the 100 results (with 3.4 M5) after having opened o.e.c.e.tests and redo the search using Search -> Again item...
What about the performance issue?
Oh, I assume that's bug 182738. Just saw you're working on it.
(In reply to comment #5) > Oh, I assume that's bug 182738. Just saw you're working on it. > Right
Verified for 3.4M6 using build I20080324-1300