jglobus / JGlobus

jGlobus is a collection of Java client libraries for Globus® Toolkit security, GRAM, and GridFTP.
http://www.globus.org/toolkit/jglobus/
Apache License 2.0
24 stars 44 forks source link

Do not accumulate matches in GlobusPathMatchingResourcePatternResolver #157

Closed jthiltges closed 8 years ago

jthiltges commented 8 years ago

The results vector is not cleared between calls to getResources() in GlobusPathMatchingResourcePatternResolver. Classes which repeatedly call the same resolver instance will get cumulative results.

The issue appears in ResourceSecurityWrapperStore.loadResources().

The accumulation of resource results appears to cause a reference leak in the ReloadableTrustStore, holding old certificate data in memory after each reload. PEMKeyStore.caDelegate grows in size with each ReloadableTrustStore.reload().

This patch allocates a new pathsMatchingLocationPattern Vector for each getResources() call.

kofemann commented 8 years ago

Thanks for the fix. Looks like pathsMatchingLocationPattern is used as a class field to pass data around. Could you fix that as well?

jthiltges commented 8 years ago

Thank you for your feedback. I've removed pathsMatchingLocationPattern as a class variable and updated the pull request.

Regards, John

kofemann commented 8 years ago

Looks good. Thanks.