Skip to content

DependencyManager improvement #1539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 12, 2025
Merged

DependencyManager improvement #1539

merged 2 commits into from
Aug 12, 2025

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Aug 4, 2025

This change affects the transitive dependency manager the most (in positive way).

All transitive managers were "derived" from ClassicDependencyManager that was the default one in Maven 3. It operates (and later ignores) mgmt entries on quite "shallow" depths (depth >= 2). Hence, the way it was coded never caused an issue, as new instances are stopped being created quite early. OTOH, transitive operates all way down and observes all mgmt entries it finds on the way. and is hence, very memory hungry.

Before this PR: each "derived" manager instance copied ALL contents from source (parent) manager, appended info as needed and stored. This causes huge memory allocation boom, as each manager instance holds (almost) same maps, as they are appended by level info if needed.

After this PR: manager instances keep track of their ancestors, and each manager keeps only "own" info, while the get/check now goes to root depMgr and descends to current. There are no more copies around of potentially huge maps. Also, removed redundant Holder use as well (kept it only on collection to memoize hash code), as it was redundant anyway and especially now, as "depth" is now meaningless: each entry is kept on own "depth" and not aggregated from root in huge maps with all entries from root to current node.

cstamas added 2 commits August 4, 2025 15:49
Also clean up UT, as commented out lines in fact hide
the issues; revert the assertions and do assert.
@cstamas cstamas marked this pull request as ready for review August 5, 2025 11:34
@cstamas cstamas self-assigned this Aug 6, 2025
@cstamas cstamas added the enhancement New feature or request label Aug 6, 2025
@cstamas cstamas added this to the 2.0.11 milestone Aug 12, 2025
@cstamas cstamas merged commit 51a3de6 into apache:master Aug 12, 2025
8 checks passed
@cstamas cstamas deleted the depmgr-path branch August 12, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant