sts4: progress view shows many AsyncLiveExpression refresh messages and doesn't respond anymore

After starting up my STS4 4.11.0 installation with an existing workspace (from an internal project), the workspace comes up, but the progress view fills up with AsyncLiveExpression refresh items and the IDE is not very responsive anymore. CPU consumption is high.

The thread dump reveals many threads in this state:

"Worker-11: AsyncLiveExpression refresh" #64 prio=5 os_prio=31 cpu=74908.87ms elapsed=77.19s tid=0x00007ff133808200 nid=0x19f3b runnable  [0x000070000fbf0000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.jdt.internal.compiler.util.SimpleLookupTable.get(SimpleLookupTable.java:74)
	at org.eclipse.jdt.internal.core.builder.ClasspathJar.findPackageSet(ClasspathJar.java:86)
	at org.eclipse.jdt.internal.core.builder.ClasspathJar.scanContent(ClasspathJar.java:361)
	at org.eclipse.jdt.internal.core.builder.ClasspathJar.listPackages(ClasspathJar.java:418)
	at org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment.indexPackageNames(JavaSearchNameEnvironment.java:223)
	at org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment.computeClasspathLocations(JavaSearchNameEnvironment.java:202)
	at org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment.<init>(JavaSearchNameEnvironment.java:93)
	at org.eclipse.jdt.internal.core.search.matching.IndexBasedJavaSearchEnvironment.create(IndexBasedJavaSearchEnvironment.java:361)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.initialize(MatchLocator.java:1222)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1260)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1373)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1515)
	at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:135)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:250)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:601)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:670)
	at org.eclipse.jdt.internal.debug.ui.launcher.MainMethodSearchEngine.searchMainMethods(MainMethodSearchEngine.java:97)
	at org.springframework.ide.eclipse.boot.dash.model.BootProjectDashElement$1.compute(BootProjectDashElement.java:83)
	at org.springframework.ide.eclipse.boot.dash.model.BootProjectDashElement$1.compute(BootProjectDashElement.java:1)
	at org.springsource.ide.eclipse.commons.livexp.core.LiveExpression.refresh(LiveExpression.java:74)
	- locked <0x0000000087cfc790> (a org.springframework.ide.eclipse.boot.dash.model.BootProjectDashElement$1)
	at org.springsource.ide.eclipse.commons.livexp.core.AsyncLiveExpression.syncRefresh(AsyncLiveExpression.java:125)
	at org.springsource.ide.eclipse.commons.livexp.core.AsyncLiveExpression$1.run(AsyncLiveExpression.java:95)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

So it looks like the search for the main method is going crazy somehow. Maybe the JDT search engine is not safe to be used in this async way?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 21 (11 by maintainers)

Most upvoted comments

@hbrands One more thing! If the project has an existing launch config then it’ll just be shown as runnable without checking for main method. Thus if project A has no main method but has a launch config it shows up for this reason.

@BoykoAlex Bingo! There was an (incomplete) LaunchConfig for this project. After deleting it, the search works as expected. Thanks for the tip. 👍

My workspace has tens (~ 40) modules and I see the AsyncLiveExpression mostly after some refactoring. Typical view: image Maybe a lot of AsyncLiveExpression refresh processes are just a visual effect, and yes, they disappear relatively fast but I see it each time during the build several times (~ 10). By feeling the building takes more time and CPU.

Same problem: lots of AsyncLiveExpression refresh and CPU is going crazy, the problem appears in Eclipse 2021-06, in Eclipse 2021-03 all seems ok…