Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STS4 Java Editor Delays - Classpath Notifications #218

Closed
neilbelchcdl opened this issue Mar 15, 2019 · 22 comments
Closed

STS4 Java Editor Delays - Classpath Notifications #218

neilbelchcdl opened this issue Mar 15, 2019 · 22 comments
Milestone

Comments

@neilbelchcdl
Copy link

STS4
Version: 4.1.2.RELEASE
Build Id: 201902210640
Eclipse Platform 4.10.0.v20181206-0815
Eclipse Java Development Tools 3.16.0.v20181206-1038

When I edit a .java file, after a few seconds my entire STS environment freezes (including menu items, etc). A few seconds later it resumes, and whatever I typed/deleted appears in the editor. It makes the program basically unusable for Java editing.

I switched on UI Responsiveness Monitoring and can see that when the delay begins, the following data appears in the Error Log:

Plug-in: org.springframework.tooling.ls.eclipse.commons
- Preparing classpath changed notification some.project.name
- exists = true open = true => deleted = false
- classpath=236 entries
- executing callback sts4.classpath.ZwJNwQiO some.project.name false 236
- executing callback sts4.classpath.ZwJNwQiO FAILED

A stack trace is also present:

java.lang.UnsupportedOperationException: No language server has registered to handle command 'sts4.classpath.ZwJNwQiO'
	at org.springframework.tooling.ls.eclipse.commons.LSP4ECommandExecutor.executeClientCommand(LSP4ECommandExecutor.java:42)
	at org.springframework.tooling.jdt.ls.commons.classpath.ReusableClasspathListenerHandler$Subscriptions$2.run(ReusableClasspathListenerHandler.java:179)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Session Data:

eclipse.buildId=4.1.2.201902210640-RELEASE
java.version=1.8.0_202
java.vendor=Amazon.com Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments:  -product org.springframework.boot.ide.branding.sts4
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4

There is also this stack trace, output to the Error Log when the UI responsiveness monitoring is triggered:

Stack Trace
    at sun.misc.Unsafe.park(Native Method)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
    at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1695)
    at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
    at java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1775)
    at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
    at org.eclipse.lsp4e.LanguageServerWrapper.stop(LanguageServerWrapper.java:350)
    at org.eclipse.lsp4e.LanguageServerWrapper.disconnect(LanguageServerWrapper.java:509)
    at org.eclipse.lsp4e.LanguageServerWrapper.stop(LanguageServerWrapper.java:363)
    at org.eclipse.lsp4e.LanguageServerWrapper.start(LanguageServerWrapper.java:184)
    at org.eclipse.lsp4e.LanguageServerWrapper.getInitializedServer(LanguageServerWrapper.java:562)
    at org.eclipse.lsp4e.DocumentContentSynchronizer.documentChanged(DocumentContentSynchronizer.java:89)
    at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:747)
    at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:716)
    at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:700)
    at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:774)
    at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1105)
    at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:176)
    at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1123)
    at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:164)
    at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:106)
    at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1098)
    at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1123)
    at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:628)
    at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:236)
    at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7390)
    at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8254)
    at org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2502)
    at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:6038)
    at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:6069)
    at org.eclipse.swt.custom.StyledText.lambda$1(StyledText.java:5767)
    at org.eclipse.swt.custom.StyledText$$Lambda$329/1187280528.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4131)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1055)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1064)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1106)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1102)
    at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1489)
    at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4888)
    at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:353)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4768)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:348)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4770)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3545)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:636)
    at org.eclipse.ui.internal.Workbench$$Lambda$21/510207317.run(Unknown Source)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1501)

At the point a .java file is opened (not edited) the following appears in the Console (with Spring Boot Language Server Console enabled):

09:09:44.134 [main] INFO  o.s.i.v.b.a.BootLanguagServerBootApp - Starting BootLanguagServerBootApp v1.4.0-SNAPSHOT on LT-13336 with PID 12552 (C:\cdl_install\sts-4.1.2.RELEASE\configuration\org.eclipse.osgi\620\data\1.4.0.201902210636-spring-boot-language-server-1.4.0-SNAPSHOT.jar started by NeilB in C:\cdl_install\sts-4.1.2.RELEASE)
09:09:44.136 [main] INFO  o.s.i.v.b.a.BootLanguagServerBootApp - No active profile set, falling back to default profiles: default
09:09:44.184 [main] INFO  o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@71e7a66b: startup date [Fri Mar 15 09:09:44 GMT 2019]; root of context hierarchy
09:09:44.624 [main] INFO  o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
09:09:45.227 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 1
09:09:45.478 [main] INFO  o.s.i.v.b.j.utils.SpringSymbolIndex - project listener registered
09:09:45.706 [main] INFO  o.s.j.e.a.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
09:09:45.719 [main] INFO  o.s.i.v.b.a.BootLanguagServerBootApp - Started BootLanguagServerBootApp in 2.663 seconds (JVM running for 3.625)
09:09:45.722 [LanguageServerApp-lifecycle] INFO  o.s.i.v.c.l.LanguageServerRunner - Server ready to start after 3628 ms
09:09:45.724 [LanguageServerApp-lifecycle] INFO  o.s.ide.vscode.commons.util.Log - Starting LS
09:09:45.724 [LanguageServerApp-lifecycle] INFO  o.s.ide.vscode.commons.util.Log - Connected to parent using stdio
09:09:45.785 [pool-3-thread-1] INFO  o.s.i.v.c.l.u.SimpleLanguageServer - Initializing
09:09:45.811 [pool-3-thread-1] INFO  o.s.i.v.c.l.u.SimpleLanguageServer - Returning server capabilities to client: ServerCapabilities [
  textDocumentSync = Either [
    left = Incremental
    right = null
  ]
  hoverProvider = true
  completionProvider = CompletionOptions [
    resolveProvider = true
    triggerCharacters = RegularImmutableList (
      "a",
      "b",
      "c",
      "d",
      "e",
      "f",
      "g",
      "h",
      "i",
      "j",
      "k",
      "l",
      "m",
      "n",
      "o",
      "p",
      "q",
      "r",
      "s",
      "t",
      "u",
      "v",
      "w",
      "x",
      "y",
      "z",
      "A",
      "B",
      "C",
      "D",
      "E",
      "F",
      "G",
      "H",
      "I",
      "J",
      "K",
      "L",
      "M",
      "N",
      "O",
      "P",
      "Q",
      "R",
      "S",
      "T",
      "U",
      "V",
      "W",
      "X",
      "Y",
      "Z",
      "."
    )
  ]
  signatureHelpProvider = null
  definitionProvider = true
  typeDefinitionProvider = null
  implementationProvider = null
  referencesProvider = true
  documentHighlightProvider = true
  documentSymbolProvider = true
  workspaceSymbolProvider = true
  codeActionProvider = Either [
    left = true
    right = null
  ]
  codeLensProvider = CodeLensOptions [
    resolveProvider = false
  ]
  documentFormattingProvider = null
  documentRangeFormattingProvider = null
  documentOnTypeFormattingProvider = null
  renameProvider = null
  documentLinkProvider = null
  colorProvider = null
  foldingRangeProvider = null
  executeCommandProvider = ExecuteCommandOptions [
    commands = SingletonImmutableList (
      "sts.vscode-spring-boot.codeAction"
    )
  ]
  workspace = WorkspaceServerCapabilities [
    workspaceFolders = WorkspaceFoldersOptions [
      supported = true
      changeNotifications = Either [
        left = 7720d750-54a3-477c-a2c7-596d631e65f8
        right = null
      ]
    ]
  ]
  semanticHighlighting = null
  experimental = null
]
09:09:45.854 [Simple-Language-Server main thread] INFO  o.s.i.v.c.l.u.SimpleLanguageServer - Initialization completed after 3760 ms
09:09:46.315 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - Project Created: file:/C:/sts-workspace/some.project.name
09:09:46.362 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - Classpath has 212 entries 186 source attachements
09:09:46.362 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - listeners registered: 1
09:09:46.362 [Simple-Language-Server main thread] INFO  o.s.i.v.b.j.l.JavaProjectsServiceWithFallback - Project created: file:/C:/sts-workspace/some.project.name
09:09:46.363 [Simple-Language-Server main thread] INFO  o.s.i.v.b.j.utils.SpringSymbolIndex - project created event: some.project.name
09:09:46.769 [Simple-Language-Server main thread] INFO  o.s.i.v.b.j.u.SpringLiveHoverWatchdog - project created event: some.project.name
09:09:46.774 [Simple-Language-Server main thread] INFO  o.s.i.v.b.a.BootLanguageServerInitializer - A project changed some.project.name, triggering reconcile on all open documents
09:09:46.999 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - Project Created: file:/C:/sts-workspace/hummingbird.rules.demo
09:09:47.090 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - Classpath has 238 entries 211 source attachements
09:09:47.090 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - listeners registered: 1
09:09:47.090 [Simple-Language-Server main thread] INFO  o.s.i.v.b.j.l.JavaProjectsServiceWithFallback - Project created: file:/C:/sts-workspace/some.different.project
09:09:47.090 [Simple-Language-Server main thread] INFO  o.s.i.v.b.j.utils.SpringSymbolIndex - project created event: some.different.project
==== Process Terminated====

Note that it mentions two different project names even though the java file belongs in some.project.name only (although a file in some.different.project is open in STS at the same time).

In STS3 the same files allow me to edit without issue.

Thanks,
Neil

@kdvolder
Copy link
Member

@neilbelchcdl Thanks for all that detail. What is this 'ui responsivness monitoring' you are talking about? That seems very usefu/interestingl to diagnose these kinds of problems! I'd appreciate a pointer to it, so we can install it ourselves, as well instruct other users reporting responsiveness issues to use it too.

The stacktrace from the 'ui responsivness monitor' is very interesting. It shows that lsp4e is trying to initialize the language server on the IDE's UI thread. I think that is why the UI is getting stuck because it may take a few seconds for this process to complete. All the while the UI would be totally stuck.

I don't see any of our own code showing up in that stacktrace so I think it is an lsp4e issue. We should raise an Eclipse bugzilla ticket agains lsp4e about this (unless we find an existing one).

@neilbelchcdl
Copy link
Author

@kdvolder No worries. The monitoring is in Preferences > General > UI Responsiveness Monitoring. It populates the Error Log however I couldn't find any way to expand that log so I struggled to capture additional data.

@kdvolder
Copy link
Member

Bug raised: https://bugs.eclipse.org/bugs/show_bug.cgi?id=545454

Let's keep an eye on it and see what happens. The stacktrace is as close to a 'smoking gun' as you'll ever find. So I think they should be able to do something with that.

@kdvolder
Copy link
Member

The monitoring is in Preferences > General > UI Responsiveness Monitoring

Thanks. Learned something today that I'm sure will come in handy in the future!

@slavap
Copy link

slavap commented Mar 30, 2019

I have kind of similar problem when using Ctrl+Click on any java class/method.
It works, but SLOW. May be it's Amazon JVM related somehow?

eclipse.buildId=4.2.0.201903290612-RELEASE
java.version=1.8.0_202
java.vendor=Amazon.com Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.springframework.boot.ide.branding.sts4
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4

org.eclipse.lsp4e
Error
Fri Mar 29 20:22:06 PDT 2019

java.util.concurrent.TimeoutException
at java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1771)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
at org.eclipse.lsp4e.operations.declaration.OpenDeclarationHyperlinkDetector.detectHyperlinks(OpenDeclarationHyperlinkDetector.java:79)
at org.eclipse.ui.texteditor.HyperlinkDetectorRegistry$HyperlinkDetectorDelegate.detectHyperlinks(HyperlinkDetectorRegistry.java:81)
at org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(HyperlinkManager.java:289)
at org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(HyperlinkManager.java:262)
at org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseMove(HyperlinkManager.java:457)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:216)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4131)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1055)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3944)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3547)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:566)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:661)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
at org.eclipse.equinox.launcher.Main.run(Main.java:1476)
at org.eclipse.equinox.launcher.Main.main(Main.java:1449)

@slavap
Copy link

slavap commented Mar 30, 2019

Also in Eclipse STS console I see the following error (not sure if it's related or not), especially puzzling why vscode is mentioned there:
20:33:59.787 [pool-2-thread-1] ERROR o.s.i.v.boot.app.SpringSymbolIndex - org.springframework.ide.vscode.boot.app.SpringSymbolIndex$InitializeProject@2d06281d threw exception
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
at java.lang.StringBuffer.append(StringBuffer.java:270)
at java.net.URI.appendSchemeSpecificPart(URI.java:1911)
at java.net.URI.toString(URI.java:1941)
at java.net.URI.(URI.java:669)
at java.net.URI.(URI.java:774)
at java.io.File.toURI(File.java:735)
at org.springframework.ide.vscode.commons.util.UriUtil.toUri(UriUtil.java:21)
at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava$1.acceptAST(SpringIndexerJava.java:148)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1071)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:662)
at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:1007)
at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.scanFiles(SpringIndexerJava.java:156)
at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.initializeProject(SpringIndexerJava.java:86)
at org.springframework.ide.vscode.boot.app.SpringSymbolIndex$InitializeProject.run(SpringSymbolIndex.java:479)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

@martinlippert
Copy link
Member

@slavap This looks clearly like the language server process is running out of memory. You can change that and configure the memory setting for that process: https://github.com/spring-projects/sts4/wiki/Custom-VM-Args

Looks like the memory issue appears while the language server tries to scan the projects for symbols. You can also reduce the memory consumption of that process by passing -Dboot.ls.symbols.ignoreMethodBodies=true to that process (using the mechanism described above), this should also significantly reduce the amount of memory that process consumes. At the moment it comes with the loss of functionality (the language server would not be able to analyze Spring Webflux router definitions anymore), but if you don't use WebFlux, you will not observe any difference.

If you want to provide more details, you could also capture a heap dump on that out-of-memory-error and send us the head dump for analysis. Sometimes this helps to get more insights into the issue (like we did for this one here: #212)

Let me know if the new settings help.

@slavap
Copy link

slavap commented Apr 1, 2019

@martinlippert Yes, adding "-Dboot.ls.custom.vmargs=-Xmx3G" resolved out-of-memory problem for me, thank you. But CompletableFuture TimeoutException is still present, no any improvements with it.

@BoykoAlex
Copy link
Contributor

@kdvolder the lagging hyperlinks should be fixed with 8468c7d

@kdvolder
Copy link
Member

kdvolder commented Apr 1, 2019

@BoykoAlex Is that the same problem as this one? At first sight it looks different. Though I guess it could have a common cause.

@ubreckner
Copy link

ubreckner commented Apr 10, 2019

Hi!

I can confirm that as of STS 4.2.0 this is still a problem and a really annoying one at that point.

Session Data

eclipse.buildId=4.2.0.201903290612-RELEASE
java.version=1.8.0_161
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.springframework.boot.ide.branding.sts4 -product org.springframework.boot.ide.branding.sts4 -product org.springframework.boot.ide.branding.sts4 -product org.springframework.boot.ide.branding.sts4
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4 -product org.springframework.boot.ide.branding.sts4 -product org.springframework.boot.ide.branding.sts4 -product org.springframework.boot.ide.branding.sts4

Stacktrace

Stack Trace
	at sun.misc.Unsafe.park(Native Method)
	at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
	at java.util.concurrent.CompletableFuture$Signaller.block(Unknown Source)
	at java.util.concurrent.ForkJoinPool.managedBlock(Unknown Source)
	at java.util.concurrent.CompletableFuture.timedGet(Unknown Source)
	at java.util.concurrent.CompletableFuture.get(Unknown Source)
	at org.springframework.tooling.boot.ls.jdt.SpringBootJavaCompletionProposalComputer.computeCompletionProposals(SpringBootJavaCompletionProposalComputer.java:55)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:336)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:340)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:334)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:291)
	at org.eclipse.jface.text.contentassist.ContentAssistant$2.lambda$0(ContentAssistant.java:2014)
	at org.eclipse.jface.text.contentassist.ContentAssistant$2$$Lambda$1541/2051182065.accept(Unknown Source)
	at java.util.Collections$SingletonSet.forEach(Unknown Source)
	at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:2013)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:2010)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:575)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.lambda$0(CompletionProposalPopup.java:505)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$$Lambda$1540/1313468456.run(Unknown Source)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:500)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1824)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:189)
	at org.eclipse.ui.texteditor.ContentAssistAction.lambda$0(ContentAssistAction.java:85)
	at org.eclipse.ui.texteditor.ContentAssistAction$$Lambda$1538/1685655423.run(Unknown Source)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
	at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:84)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
	at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:121)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:96)
	at sun.reflect.GeneratedMethodAccessor456.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:320)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:254)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:497)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:490)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:308)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:584)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:653)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:443)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$2(KeyBindingDispatcher.java:386)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:96)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1194)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1054)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1064)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1106)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1102)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1489)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4888)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:353)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4768)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:348)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4770)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3545)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.ui.internal.Workbench$$Lambda$52/1824877362.run(Unknown Source)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:566)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1501)

Seems to be exactly the same problem as described by @neilbelchcdl
For me it occurs when, amongst other things, while using content assist (ctrl + space) and waiting for the "Open Declaration/Implementation" context menu (ctrl + hover while pointing at a bean method).

Best regards,
Uwe

@BoykoAlex
Copy link
Contributor

@ubreckner I saw you mentioning "ctrl+hover while pointing at a bean method". There was a bug around that for which we pushed the fix after 4.2.0. Any chance you can try updating from the nightly build update site: https://dist.springsource.com/snapshot/TOOLS/sts4/nightly/e4.11 and see if the problem is fixed in the snapshot? (If you have STS4 based eclipse 4.10 the site would be https://dist.springsource.com/snapshot/TOOLS/sts4/nightly/e4.10)

@martinlippert
Copy link
Member

@ubreckner the content-assist issue in your java editor seems to be a different one than the issue that @BoykoAlex talked about in the previous comment (which is about the hyperlink). I wonder why the content-assist from the spring-boot-language-server isn't responding (which could be super annoying, totally agree).

It might be related to the language server consuming too much memory or running into another problem. One way to debug this would be to enable the log output streaming to the console via the preference settings at Language Servers -> Spring Language Servers and check the console debug output. You need to restart your IDE for this to take effect.

Another option would be to fire up jconsole and connect to the language server process (which is a different one than the main IDE) to see if that one is running out of memory, for example.

Another good data point would be to indeed try the nightly builds mentioned above, there are a number of improvements (also around memory consumption) implemented that might help (in case this is the underlying problem).

Also if you can share a project that could help us to reproduce the issue, that would be more than welcome (in case that is possible).

As a quick fix, you could disable the Spring Boot language server being activated for Java files altogether in the preferences Language Servers (disable it for the Java source file content type in the table).

@ubreckner
Copy link

Hey @BoykoAlex, i will be updating from the nightly build and give you feedback.

@mweirauch
Copy link

I had updated to nightly/e4.11 this morning and I noticed a difference. E.g. selecting "Open Implementation" was actually clickable in the appearing ctrl+click popup.

Can't promise there's no "UI freeze" entries in the Eclipse error log anymore, as it is spammed immedeately with "Unhandled event loop exception" entries when looking at it.

@martinlippert
Copy link
Member

@mweirauch Can you post some details about the "Unhandled event loop exceptions", please? Would like to take a look and see what might be going wrong there.

@mweirauch
Copy link

@martinlippert Not sure it is STS4 related. They appear when I move the mouse over or click an entry or mouse-over the search bar in the "Error Log" view itself.

eclipse.buildId=4.11.0.I20190307-0500
java.version=1.8.0_201
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -data file:/store/data/workspace/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

This is a continuation of log file /store/data/workspace/.metadata/.bak_1.log
Created Time: 2019-04-11 10:58:50.599

org.eclipse.ui
Error
Thu Apr 11 16:41:54 CEST 2019
Unhandled event loop exception

java.lang.NullPointerException
	at org.eclipse.ui.internal.views.log.LogView.onMouseMove(LogView.java:1420)
	at org.eclipse.ui.internal.views.log.LogView.lambda$9(LogView.java:1276)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5783)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1411)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5051)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4579)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:566)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:661)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1476)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1449)

@martinlippert
Copy link
Member

@mweirauch Agree, looks indeed not related to anything Spring Tools specific, you should report that to bugs.eclipse.org for sure.

In case you would like to take a look at the log file and search for items, you could also open that file using a random editor of your choice, it should be located at: <workspace>/.metadata/.log.

@ubreckner
Copy link

@martinlippert, @BoykoAlex the hyperlink problem seems to be an memory issue as it appears with a timeout exception. I'm going to check whether more memory does the trick.
I have the subjective impression the update from the nightly builds have reduced the timeout frequency though i can't really pin it to the logs.

Concerning the failing content assist: after restarting the IDE everything works fine. The responsiveness just starts fading after some hours. I have turned on the console debugging of the language server and keep an eye on it. If nothing pops up and the behavior is still the same i'll attach jconsole.

Thanks for the hints. I'll get back to you once i have some updates.

@slavap
Copy link

slavap commented Apr 19, 2019

@martinlippert I've updated to 4.2.1 today and "Ctrl+Click on any java class/method" problem is resolved for me.

@ubreckner
Copy link

As of 4.2.2 there are no further problems on my side. Thanks guys!

@martinlippert
Copy link
Member

Thanks @ubreckner and @slavap for the feedback and great to hear that things are working now for you. Closing this issue now. Thanks again for your help reporting and identifying the issue. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants