ResolvedArtifactFactory appears to retain references to Ivy's Artifact structure

(Justin Ryan) #1

While looking at DefaultResolvedArtifact, I see a comment “The artifact instance drags in a whole pile of stuff that we don’t want to retain references to.” But I believe the artifactSource being passed in from DefaultResolvedConfigurationBuilder has some closures which retain a reference on the artifact object nonetheless, in line 43 of ResolvedArtifactFactory. If you truly want to the artifact to be able to be garbage collected, then ResolvedArtifactFactory needs to be changed.

This is not necessarily affecting me, I just noticed this in the code. Honestly I’d rather have easier access to the ModuleDescriptor from a ResolvedModule.

(Peter Niederwieser) #2

Thanks for the pointer. I’ve raised GRADLE-2908 to make sure that it isn’t forgotten.