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

ASF GitHub Bot commented on MRESOLVER-587:
------------------------------------------

gsmet commented on code in PR #536:
URL: https://github.com/apache/maven-resolver/pull/536#discussion_r1701742710


##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DataPool.java:
##########
@@ -257,7 +257,7 @@ public static final class DescriptorKey {
 
         private DescriptorKey(Artifact artifact) {
             this.artifact = artifact;
-            this.hashCode = buildHashCode();
+            this.hashCode = Objects.hashCode(artifact);

Review Comment:
   Ah yeah sorry, I was used to more complex hashCode construction and kept 
this pattern (we avoid using `Objects.hash` as it allocates an array and can be 
problematic in some cases so we end up with traditional boilerplate hashCodes).





> Memory consumption improvements
> -------------------------------
>
>                 Key: MRESOLVER-587
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-587
>             Project: Maven Resolver
>          Issue Type: Improvement
>          Components: Resolver
>            Reporter: Tamas Cservenak
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: 2.0.1, 1.9.22
>
>
> In DataPool, following can be done to reduce memory usage:
>  * -ArtifactDescriptor key does not have to be Artifact instance, is really 
> just GACEV needed (is identity)- WRONG, it must be Artifact. Still, some 
> improvement is done introducing new key type.
>  * ArtifactDescriptors could have "interned" the List<Dependency> fields as 
> well
> Latter is done and controlled by two new configuration properties:
> * {{aether.dependencyCollector.pool.internArtifactDescriptorDependencies}} 
> defaults to {{false}}
> * 
> {{aether.dependencyCollector.pool.internArtifactDescriptorManagedDependencies}}
>  defaults to {{true}}
> Having true/true tremendously improve memory consumption but increases 
> runtime. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to