Skip to main content

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

Hi,

I'm solving performance problems with maven "update dependecies"
process, mainly in Eclipse, but easy reproducible with maven from
command line:

enviroment: Eclipse with m2e, maven runtime 3.0.4 with latest aether
from sonatype 1.13.1, about 600 project in workspace (Question: is
anywhere maven updated to  aether form org.eclipse package?)

process update dependecies for whole workspace (after fresh eclipse
start) 

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

2) invokes 1 mil. - 3mil method
org.sonatype.aether.util.graph.transformer.NearestVersionConflictResolver.selectVersion per one project, i.e . about 850 mil invocations pro whole workspace

The problem is that process takes too much time and consumes too much
memory.

A) First, I detected, that many instances of Dependency type are created
when too wide version range is used. I removed some unnecessary version
ranges - this helped a lot, but results are still slow.

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?

C) But I see still any instances of aether.* types in memory. This was
reported also in m2e mailing list as [1] and by me [2]

Question: are there any tips how to optimize pom.xml to avoid
unnecessary object created during dependency resolving?

For example, creates section <dependencyManagement> new instances from
aether domain? We have a big <dependencyManagement>  section in parent
(for all 600 project) pom.xml.

Many thanks,

Martin

[1] http://dev.eclipse.org/mhonarc/lists/m2e-users/msg02275.html
[2] http://dev.eclipse.org/mhonarc/lists/m2e-users/msg02459.html








Back to the top