Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] performance: creation of DependencyNode, DefaultArtifact and Dependency

Hi, 

thanks for your answer. Comments below.

Benjamin Bentmann píše v Čt 19. 04. 2012 v 01:04 +0200:
> Martin Koci wrote:
> 
> > 1) creates  many instances of
> > org.sonatype.aether.util.artifact.DefaultArtifact: ~ 1 290 948 instances
> > org.sonatype.aether.graph.Dependency  ~ 1 283 202 instances
> > Those instances cannot be GCed, relations come from
> > org.apache.maven.MavenProject
> 
> Can you detail all chains of objects/fields holding the artifact instances?

The holding structure is
(simplified)org.eclipse.osgi.framework.internal.core.Framework ->
org.eclipse.m2e.core.internal.MavenPluginActivator ->
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager ->
org.eclipse.m2e.core.internal.project.registry.ProjectRegistry.workspacePoms->
workspacePoms is Map<IFile, MavenProjectFacade> ->
org.eclipse.m2e.core.internal.project.registry.MavenProjectFacade ->
org.apache.maven.project.MavenProject ->
org.sonatype.aether.util.DefaultRepositorySystemSession ->
org.sonatype.aether.graph.Dependency 

> Also, how many dependencies does your workspace have in total?
> 
Hard to say, but many. How to count them? In workspace are many project
with 100 dependencies or more. The number of instances from aether can
be correct, the workspace and its dependecies is really big. I'm not
reporting a bug in aether, just asking ;)
> > The problem is that process takes too much time and consumes too much
> > memory.
> 
> What are the concrete numbers for "too much"?
in terms of time : It depends on CPU of the computer: update
dependencies takes 20min - 45 min; we  use already m2e with option "do
not automatically contact remote repositories" so (I hope) that process
does not include a communication over net. Yourkitprofiler shows the
method NearestVersionConflictResolver.selectVersion as hotspot.

In terms of memory: Dependency instances retain 591MB, DefaultArtifact
550MB, together with other plugins allocates eclipse over 1400MB in
heap.

> 
> > B) Then: I noticed that when the same dependency is in "client" project
> > and also as a transitive dependency,  then is this DependencyNode
> > processed 2x: when I removed dependecies already present as transitive,
> > it improved performance a little bit.
> >
> > Question: Is this assumption correct? Is better to have use "optimize"
> > pom.xml in this way?
> 
> Even after reading this twice, I have no clue what this paragraph means. 
> Can you re-phrase?
> 
Sorry, it's really chaotic. Let's have Dependecy A. Then:
project B: depends on A
project C: depends on B and A

As result, Project C has dependency A twice: 1) direct dependency 2)
transitive dependency from B. When I remove the direct dependency, will
be resolution faster?

> > Question: are there any tips how to optimize pom.xml to avoid
> > unnecessary object created during dependency resolving?
> 
> No.
> 
> > For example, creates section<dependencyManagement>  new instances from
> > aether domain? We have a big<dependencyManagement>   section in parent
> > (for all 600 project) pom.xml.
> 
> Of course, dependency management is relevant for dependency resolution 
> so at some point manifests in corresponding objects to process it. Those 
> should however only be temporary and not persist once dependency 
> resolution is done.
> 
Theoreticaly, when we minimize dependencyManagement section, will be
resolution faster?

Many thanks,

Martin

> 
> Benjamin
> _______________________________________________
> aether-users mailing list
> aether-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aether-users




Back to the top