Bug 309220 - Updating plugin dependencies takes forever
Summary: Updating plugin dependencies takes forever
Status: CLOSED DUPLICATE of bug 302295
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 16:53 EDT by Martin Aeschlimann CLA
Modified: 2018-06-25 08:32 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2010-04-14 16:53:36 EDT
SDK 3.6 M6

- I had to reload my RTC Jazz workspace (~800 plugins)
- for over 30 minutes the workspace was busy with 'Updating plugin dependencies' 
- Before I worked with Eclipse 3.6 M4 and haven't see any problems like this
- looking at the threads running with JConsole, there were many jobs started 'Update classpath'. Each of them took 1/2 minute to finish
Looking at the stack traces, I often found active the thread running
org.eclipse.jdt.internal.compiler.util.ManifestAnalyzer.analyzeManifestContents(ManifestAnalyzer.java:48)

e.g.
org.eclipse.jdt.internal.compiler.util.ManifestAnalyzer.analyzeManifestContents(ManifestAnalyzer.java:48)
org.eclipse.jdt.internal.core.ClasspathEntry.getCalledFileNames(ClasspathEntry.java:957)
org.eclipse.jdt.internal.core.ClasspathEntry.resolvedChainedLibraries(ClasspathEntry.java:920)
org.eclipse.jdt.internal.core.ClasspathEntry.resolvedChainedLibraries(ClasspathEntry.java:907)
org.eclipse.jdt.internal.core.ClasspathEntry.resolvedChainedLibraries(ClasspathEntry.java:1440)
org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2671)
org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2777)
org.eclipse.jdt.internal.core.ClasspathChange.generateDelta(ClasspathChange.java:218)
org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1916)
org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470)
org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
Comment 1 Martin Aeschlimann CLA 2010-04-14 16:56:17 EDT
Alls often seen when using JConsole to see where the active threads are working:

org.eclipse.jdt.internal.compiler.util.ManifestAnalyzer.analyzeManifestContents(ManifestAnalyzer.java:48)
org.eclipse.jdt.internal.core.ClasspathEntry.getCalledFileNames(ClasspathEntry.java:957)
org.eclipse.jdt.internal.core.ClasspathEntry.resolvedChainedLibraries(ClasspathEntry.java:920)
org.eclipse.jdt.internal.core.ClasspathEntry.resolvedChainedLibraries(ClasspathEntry.java:907)
org.eclipse.jdt.internal.core.ClasspathEntry.resolvedChainedLibraries(ClasspathEntry.java:1440)
org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2671)
org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2777)
org.eclipse.jdt.internal.core.ClasspathChange.generateDelta(ClasspathChange.java:218)
org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1916)
org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470)
org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
Comment 2 Darin Wright CLA 2010-04-14 22:00:07 EDT
The jobs are originating from PDE/UI component. However, CC'ing Olivier, since the time factor seems to be coming from JDT. Note that PDE is intending on coalescing the update jobs - but I don't think it will reduce the amount of work being done (bug 305242).
Comment 3 Olivier Thomann CLA 2010-04-19 11:18:42 EDT
Jay, please contact Martin to get a reproducable test case. This might be a performance regression. I just don't see why this would be that slow.
Comment 4 Jay Arthanareeswaran CLA 2010-04-20 02:32:46 EDT
(In reply to comment #3)
> Jay, please contact Martin to get a reproducable test case. This might be a
> performance regression. I just don't see why this would be that slow.

One of the reasons I could think of is the change to the method org.eclipse.jdt.internal.core.JavaModelManager.getNonChainingJarsCache() as part of fix to bug 305122.
Earlier (i.e. before the fix to bug 305122), the non-chaining cache was virtually used only between a full-save (or shut-down) and start-up. Once the cache is reset (during classpath re-computation etc.) it never gets populated again before a full-save is made. When the workspace is saved (or shut-down), all the classpath entries in all projects are iterated through and the list of jars that have no references to other jars (via MANIFEST) is collected and persisted. And so, when the workspace is reloaded, the cache is available and the over-head is avoided.

After the fix to the aforementioned bug, the cache is not recomputed during shut-down, even if there is one entry in the cache. Since the full cache was not computed during last shut-down, the classpath resolution has to look through each JAR's manifest for referenced libraries. To confirm this, I have this question to Martin - do you see the shut-down taking any lesser time now when compared to 3.6M4?

I will alter this code a bit and provide Martin a plug-in patch and see if it helps.
Comment 5 Martin Aeschlimann CLA 2010-04-20 03:47:21 EDT
> do you see the shut-down taking any lesser time now
> when compared to 3.6M4?
I can't say, I didn't notice any unusual long time taken on shutdown on M4 and also for M6 everything works nicely.

>I will alter this code a bit and provide Martin a plug-in patch and see if it
> helps.
That would be nice, but note that I don't intend to crash my workspace again and reload. So don't expect me to validate the fix. It would be good to measure this out with a profiler on a very large workspace.
Comment 6 Jay Arthanareeswaran CLA 2010-04-20 06:37:05 EDT
(In reply to comment #5)
> That would be nice, but note that I don't intend to crash my workspace again
> and reload. So don't expect me to validate the fix. It would be good to measure
> this out with a profiler on a very large workspace.

Ah, I was hoping that you would be able to help me with that. Perhaps can you provide me the exact steps that lead to this situation? For e.g. you mentioned that your workspace crashed before you noticed this problem. Could you confirm that when you closed the workspace properly and reloaded again, things were alright?
Comment 7 Olivier Thomann CLA 2010-04-20 11:52:53 EDT
Jay,

Could you please try to profile this code to make sure we don't have any bottleneck that could easily be fixed?

Martin,

Could you please provide a big workspace to Jay so that he can work on data that reflects the problem?

Thanks.
Comment 8 Martin Aeschlimann CLA 2010-04-20 11:57:06 EDT
I don't think any crash played a role here.
I simply repopulated my workspace: deleting all plugins and loading all plugins and features again from source control.
Auto build was off.
After loading all projects, 'Updating plugin dependencies' was using 1/2 hour to complete.
After that I closed the workspace and restarted. Restarting was fine, didn't observe any slow down compared to other restarts.
Comment 9 Martin Aeschlimann CLA 2010-04-20 11:59:29 EDT
Jay, do you have anybody working on Jazz near you?

I assume loading all projects in the Eclipse SDK should be big enough to make good measurements.
Comment 10 Olivier Thomann CLA 2010-04-21 09:39:13 EDT
I'll try to profile it.
Comment 11 Olivier Thomann CLA 2010-04-29 09:59:20 EDT
I am waiting for data from Martin.
Comment 12 Olivier Thomann CLA 2010-04-30 09:53:36 EDT
The decoding of the manifest itself is fast.
I will try to load many projects to see if I can see anything obvious.
Comment 13 Olivier Thomann CLA 2010-04-30 13:31:49 EDT
It looks like that most of the time is spent inside the refreshing of external resources.
I'll try to debug what external resources are refreshed.

I also noticed that the label decoration "Java build path indicator" is triggering classpath resolution during the check out of projects.
Comment 14 Olivier Thomann CLA 2010-04-30 16:01:58 EDT
Jay,

Could you please investigate using debug statements to see what is done during the refresh of external resources? My machine just doesn't scale to profile big test cases like this one required.
Comment 15 Jay Arthanareeswaran CLA 2010-05-11 05:12:12 EDT
(In reply to comment #14)
> Jay,
> 
> Could you please investigate using debug statements to see what is done during
> the refresh of external resources? My machine just doesn't scale to profile big
> test cases like this one required.

It's true we did have issues with refreshing external folders, which is fixed in 302295. The issue was that external folders were refreshed once for each project in the workspace. Perhaps that's what you are seeing?

Martin, could you please try one of the recent builds and see if you still have this problem?
Comment 16 Dani Megert CLA 2010-07-20 09:45:01 EDT
Chatted with Martin: he hasn't seen this bug with latest builds.

*** This bug has been marked as a duplicate of bug 302295 ***
Comment 17 Alexander Kerner CLA 2017-07-03 12:51:48 EDT
See this bug all the time using latest Neon. Also "Updating plug-in dependencies" does not only take forever, the IDE is also not responsive anymore.
Comment 18 Alexander Kerner CLA 2017-07-07 09:38:07 EDT
I think this is not a duplicate, since using Eclipse's suggestions on package import/ Bundle import (Plugin-Development) causes this error too.
Comment 19 Alexander Kerner CLA 2017-07-07 09:49:38 EDT
Everything that affects the classpath can (for me will) cause this problem.
Comment 20 Michael Moser CLA 2018-06-25 07:09:49 EDT
Running 4.6 (Neon) and have the same bug again! As soon as Eclipse figures it needs to go into "Updating plugin dependencies" it's coffee time (5-15(!) minues) :-(

No wonder is this beast slowly dying...
Comment 21 Dani Megert CLA 2018-06-25 08:32:00 EDT
(In reply to Michael Moser from comment #20)
> Running 4.6 (Neon) and have the same bug again! As soon as Eclipse figures
> it needs to go into "Updating plugin dependencies" it's coffee time (5-15(!)
> minues) :-(
> 
> No wonder is this beast slowly dying...

Please file a new bug report with steps to reproduce or with a test case.