maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject maven git commit: [MNG-6030] ReactorModelCache do not used effectively after maven version 3.0.5 which cause a large memory footprint o Reintroduced ReactorModelCache reduces the memory footprint.
Date Tue, 31 May 2016 20:47:56 GMT
Repository: maven
Updated Branches:
  refs/heads/master 4e5e5861b -> 41144e7ec


[MNG-6030] ReactorModelCache do not used effectively after maven version 3.0.5 which cause
a large memory footprint
 o Reintroduced ReactorModelCache reduces the memory footprint.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/41144e7e
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/41144e7e
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/41144e7e

Branch: refs/heads/master
Commit: 41144e7ecf52e7ec3850f3e78d81f42f505f4af8
Parents: 4e5e586
Author: Karl Heinz Marbaise <khmarbaise@apache.org>
Authored: Tue May 31 21:39:31 2016 +0200
Committer: Karl Heinz Marbaise <khmarbaise@apache.org>
Committed: Tue May 31 22:43:19 2016 +0200

----------------------------------------------------------------------
 .../maven/project/DefaultProjectBuilder.java       | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/41144e7e/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
index fb15c87..2406ff9 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
@@ -112,14 +112,14 @@ public class DefaultProjectBuilder
     public ProjectBuildingResult build( File pomFile, ProjectBuildingRequest request )
         throws ProjectBuildingException
     {
-        return build( pomFile, new FileModelSource( pomFile ), new InternalConfig( request,
null ) );
+        return build( pomFile, new FileModelSource( pomFile ), new InternalConfig( request,
null, null ) );
     }
 
     @Override
     public ProjectBuildingResult build( ModelSource modelSource, ProjectBuildingRequest request
)
         throws ProjectBuildingException
     {
-        return build( null, modelSource, new InternalConfig( request, null ) );
+        return build( null, modelSource, new InternalConfig( request, null, null ) );
     }
 
     private ProjectBuildingResult build( File pomFile, ModelSource modelSource, InternalConfig
config )
@@ -271,7 +271,7 @@ public class DefaultProjectBuilder
         request.setUserProperties( configuration.getUserProperties() );
         request.setBuildStartTime( configuration.getBuildStartTime() );
         request.setModelResolver( resolver );
-        request.setModelCache( new ReactorModelCache() );
+        request.setModelCache( config.modelCache );
 
         return request;
     }
@@ -290,7 +290,7 @@ public class DefaultProjectBuilder
         org.eclipse.aether.artifact.Artifact pomArtifact = RepositoryUtils.toArtifact( artifact
);
         pomArtifact = ArtifactDescriptorUtils.toPomArtifact( pomArtifact );
 
-        InternalConfig config = new InternalConfig( request, null );
+        InternalConfig config = new InternalConfig( request, null, null );
 
         boolean localProject;
 
@@ -352,7 +352,9 @@ public class DefaultProjectBuilder
 
         ReactorModelPool modelPool = new ReactorModelPool();
 
-        InternalConfig config = new InternalConfig( request, modelPool );
+        ReactorModelCache modelCache = new ReactorModelCache();
+
+        InternalConfig config = new InternalConfig( request, modelPool, modelCache );
 
         Map<String, MavenProject> projectIndex = new HashMap<>( 256 );
 
@@ -893,11 +895,14 @@ public class DefaultProjectBuilder
         public final List<RemoteRepository> repositories;
 
         public final ReactorModelPool modelPool;
+        
+        public final ReactorModelCache modelCache;
 
-        InternalConfig( ProjectBuildingRequest request, ReactorModelPool modelPool )
+        InternalConfig( ProjectBuildingRequest request, ReactorModelPool modelPool, ReactorModelCache
modelCache )
         {
             this.request = request;
             this.modelPool = modelPool;
+            this.modelCache = modelCache;
             session =
                 LegacyLocalRepositoryManager.overlay( request.getLocalRepository(), request.getRepositorySession(),
                                                       repoSystem );


Mime
View raw message