Yougoss commented on PR #768: URL: https://github.com/apache/maven/pull/768#issuecomment-1210030051
@andreybpanfilov , my intention for the WeakHashMap is not impact those dependency instances cleanup by GC. If I use a HashMap, when the dependency graph has been resolved, those dependency instances can't be cleanup by GC since the cache is a static field and own strong reference to dependency instances. But If I use WeakHashMap, if there is not enough memory and trigger GC, the key will be cleanup after GC since it's WeakReference, and then there is no strong reference to those dependency instances, so that they can be cleanup if there is no reference from dependency graph. So the intention is, I don't want to make those dependency instances survive all the times after I use a static Map to cache them. Not get your point yet. Can you please share more details? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
