[ https://issues.apache.org/jira/browse/MNG-7509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17564496#comment-17564496 ]
ASF GitHub Bot commented on MNG-7509: ------------------------------------- Yougoss opened a new pull request, #764: URL: https://github.com/apache/maven/pull/764 Following this checklist to help us incorporate your contribution quickly and easily: - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [x] Each commit in the pull request should have a meaningful subject line and body. - [x] Format the pull request title like `[MNG-XXX] SUMMARY`, where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA issue. Best practice is to use the JIRA issue title in the pull request title and in the first line of the commit message. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [x] You have run the [Core IT][core-its] successfully. If your pull request is about ~20 lines of code you don't need to sign an [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure please ask on the developers list. To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) you have to acknowledge this by using the following check-box. - [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) - [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). [core-its]: https://maven.apache.org/core-its/core-it-suite/ > Huge memory cost when parent pom widely used in a big project for > dependencyManagement > -------------------------------------------------------------------------------------- > > Key: MNG-7509 > URL: https://issues.apache.org/jira/browse/MNG-7509 > Project: Maven > Issue Type: Improvement > Components: Performance > Reporter: Xiong Luyao > Priority: Major > Attachments: image-2022-07-09-09-37-53-823.png, > image-2022-07-09-09-38-26-354.png, image-2022-07-09-10-27-12-668.png, > image-2022-07-09-10-27-56-437.png, image-2022-07-09-10-28-05-706.png, > image-2022-07-09-10-28-22-864.png, image-2022-07-09-10-28-35-341.png, > image-2022-07-09-10-28-40-612.png, image-2022-07-09-10-29-04-045.png, > image-2022-07-09-10-29-15-822.png, image-2022-07-09-10-29-21-991.png, > image-2022-07-09-10-29-46-216.png, image-2022-07-09-10-29-51-456.png > > > When maven try to resolve dependency relationship, it will create many > objects of dependency / artifact. Even the dependency/artifact content is > totally same, but just in different models. It cost huge memory if there is a > big dependencyManagement parent pom in each dependencies of the project. > > Here is a real case. As below picture, there is over 3000 business domain > libraries, each library may rely on several other libraries among them. So > the library which didn’t rely on each other will be built first and the > library only relies on the built libraries will be built, until all the > libraries have been built. In this way, we use a parent pom to maintain the > version of these 3000+ libraries version and make each library introduce it. > So that it can keep all the libraries are built from same base. > But it costs huge memory in above ways to built libraries. And even the > libraries have been released, if the project which contains a lot of above > libraries, it also cost huge memory when building project. > > !image-2022-07-09-09-37-53-823.png|width=493,height=226! > > Here is a thread dump when building a real project with above libraries. The > top 5 objects are all related to org.eclipse.aether.graph.Dependency. > !image-2022-07-09-09-38-26-354.png|width=510,height=199! > > -- This message was sent by Atlassian Jira (v8.20.10#820010)