[ 
https://issues.apache.org/jira/browse/MNG-6571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16750171#comment-16750171
 ] 

Hervé Boutemy edited comment on MNG-6571 at 1/23/19 4:09 PM:
-------------------------------------------------------------

yes, I understand that in your case you don't have anything that change any 
little field in the dependencyManagement section, then everything looks like a 
big waste of memory
but you may add a little override somewhere
the maven model merging is here : 
https://maven.apache.org/ref/3.6.0/maven-model-builder/
I'm convinced that the vast majority of time, dependencies (be it in 
dependencyManagement or base dependencies) are inherited without any 
modification: that's why at first I imagined that it was feasible
but sometimes, dependencies are modified when inheriting

in 
[ModelMerger|https://maven.apache.org/ref/3.6.0/maven-model/apidocs/org/apache/maven/model/merge/ModelMerger.html],
 mergeDependency(Dependency target, Dependency source, boolean sourceDominant, 
Map<Object,Object> context) is not really an immutable friendly signature
and also given [Dependency 
code|https://maven.apache.org/ref/3.6.0/maven-model/apidocs/org/apache/maven/model/Dependency.html]
 is generated by Modello, changing it to immutable form is not easy either

really, the magic of VersionRange was that it was already immutable: only the 
cache was not there, then I had near nothing to do, just take the benefits that 
were forgotten
but it's the only case like this, other cases will be much harder...

that does not mean that we won't do it in a future release: it just means that 
we should do a release with VersionRange cache before trying to do more


was (Author: hboutemy):
yes, I understand that in your case you don't have anything that change any 
little field in the dependencyManagement section, then everything looks like a 
big waste of memory
but you may add a little override somewhere
the maven model merging is here : 
https://maven.apache.org/ref/3.6.0/maven-model-builder/
I'm convinced that the vast majority of time, dependencies (be it in 
dependencyManagement or base dependencies) are inherited without any 
modification: that's why at first I imagined that it was feasible
but sometimes, dependencies are modified when inheriting

in 
[ModelMerger|https://maven.apache.org/ref/3.6.0/maven-model/apidocs/org/apache/maven/model/merge/ModelMerger.html],
 mergeDependency(Dependency target, Dependency source, boolean sourceDominant, 
Map<Object,Object> context) is not really an immutable friendly signature
and also given [Dependency 
code|https://maven.apache.org/ref/3.6.0/maven-model/apidocs/org/apache/maven/model/Dependency.html]
 is generated by Modello, changing it to immutable form is not easy either

really, the magic of VersionRange was that it was already immutable: only the 
cache was not there, then I had near nothing to do
but it's the only case like this, other cases will be much harder...

that does not mean that we won't do it in a future release: it just means that 
we should do a release with VersionRange cache before trying to do more

> Maven memory consumption issue
> ------------------------------
>
>                 Key: MNG-6571
>                 URL: https://issues.apache.org/jira/browse/MNG-6571
>             Project: Maven
>          Issue Type: Wish
>    Affects Versions: 3.6.0
>            Reporter: Hervé Boutemy
>            Assignee: Hervé Boutemy
>            Priority: Major
>         Attachments: Maven-Reactor-Dump-Patched.png, Maven-Reactor-Dump.png
>
>
> as reported on Users list: 
> https://lists.apache.org/thread.html/7d75142448b3c234742bdfd3c743e2f62065fe8e0a313905cbbb2523@%3Cusers.maven.apache.org%3E
> then with details on Dev list: 
> https://lists.apache.org/thread.html/34b64295238594e554f1f2f119848bce3b60d4e1e22e09f26aa64166@%3Cdev.maven.apache.org%3E



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to