Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 520426

Summary: Debug performance is very poor with Ivy
Product: [Eclipse Project] JDT Reporter: Alex X <a701440>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: sarika.sinha
Version: 4.8   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug

Description Alex X CLA 2017-08-01 11:45:49 EDT
When using Ivy and attaching to remote process for debugging performance is very poor. See stacks with IvyDE calls, resolution takes minutes before Eclipse debugger is functional.

java.lang.Object.wait(Native Method)
java.lang.Thread.join(Thread.java:1253)
org.apache.ivyde.internal.eclipse.resolve.IvyRunner.launchIvyThread(IvyRunner.java:49)
org.apache.ivyde.internal.eclipse.resolve.IvyResolveJob.launchResolveThread(IvyResolveJob.java:292)
org.apache.ivyde.internal.eclipse.resolve.IvyResolveJob.doRun(IvyResolveJob.java:224)
org.apache.ivyde.internal.eclipse.resolve.IvyResolveJob.run(IvyResolveJob.java:85)
org.apache.ivyde.internal.eclipse.resolve.IvyResolveJob.launchRequest(IvyResolveJob.java:73)
org.apache.ivyde.internal.eclipse.IvyDERuntimeClasspathEntryResolver.computeDefaultContainerEntries(IvyDERuntimeClasspathEntryResolver.java:101)
org.apache.ivyde.internal.eclipse.IvyDERuntimeClasspathEntryResolver.computeDefaultContainerEntries(IvyDERuntimeClasspathEntryResolver.java:85)
org.apache.ivyde.internal.eclipse.IvyDERuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(IvyDERuntimeClasspathEntryResolver.java:63)
org.eclipse.jdt.internal.launching.RuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(RuntimeClasspathEntryResolver.java:46)
org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:944)
org.eclipse.jdt.launching.StandardSourcePathProvider.resolveClasspath(StandardSourcePathProvider.java:91)
org.eclipse.jdt.launching.JavaRuntime.resolveSourceLookupPath(JavaRuntime.java:838)
org.eclipse.jdt.launching.sourcelookup.containers.ClasspathContainerSourceContainer.createSourceContainers(ClasspathContainerSourceContainer.java:87)
org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.getSourceContainers(CompositeSourceContainer.java:133)
   - locked org.eclipse.jdt.launching.sourcelookup.containers.ClasspathContainerSourceContainer@644e491d
org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.findSourceElements(CompositeSourceContainer.java:48)
org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant.findSourceElements(AbstractSourceLookupParticipant.java:70)
org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector$SourceLookupQuery.run(AbstractSourceLookupDirector.java:142)
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.doSourceLookup(AbstractSourceLookupDirector.java:505)
org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.getSourceElement(AbstractSourceLookupDirector.java:785)
org.eclipse.jdt.internal.debug.core.JavaDebugUtils.doSourceLookup(JavaDebugUtils.java:396)
Comment 1 Sarika Sinha CLA 2017-08-01 22:00:58 EDT
Can you please provide the steps for setup and to reproduce the slow performance.
Comment 2 Alex X CLA 2017-08-02 10:05:48 EDT
It's hard to say what the exact reason for the problem. 

The workspace is very large ~100 of projects. The dependencies between the projects and between projects and third-party jars are managed using Ivy and IvyDE plugin is used. 

The app JVM runs on local machine and attaching to a port on localhost is used to start debugging. When trying to step the first time a breakpoint is hit Eclipse enters into a very long process of looking up something using Ivy (as shown by the call-stack). Some information such as looking at the values of the local variables is available immediately, but stepping requires waiting for this process to finish which may take up to several minutes in our environment. There is obviously local Ivy cache, the drive is SSD, etc.

This process repeats if you detach from the JVM and attach again.
Which is a bummer since nothing in Ivy changes...
Comment 3 Sarika Sinha CLA 2017-08-03 00:39:06 EDT
Can you provide the steps to setup Ivy with Eclipse and a sample project which usses  a kind of code which is similar to your problem. Without all this it will difficult to proceed.
Comment 4 Alex X CLA 2017-12-29 14:08:33 EST
It may be hard to setup and requires large number of Ivy dependencies.
I guess the point is visible from the call-stack in the original message.
When debugger is attached to a process and break-point is hit it tries to lookup the location of the source code. I assume "JavaDebugUtils.doSourceLookup" is a part of that process. You can see in the call-stack that this triggers Ivy resolve process that can take fairly long time. Ivy resolve has been already done before the debugging session was started, so there should be no need to do this really.
Comment 5 Eclipse Genie CLA 2020-01-26 11:53:45 EST
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.