You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Bob Paulin (Jira)" <ji...@apache.org> on 2026/01/05 14:57:00 UTC
[jira] [Updated] (NIFI-15388) Leak in ReflectionUtils annotation cache.
[ https://issues.apache.org/jira/browse/NIFI-15388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bob Paulin updated NIFI-15388:
------------------------------
Summary: Leak in ReflectionUtils annotation cache. (was: Leak in ReflectionUtils annotation cache. Value should use WeakReference)
> Leak in ReflectionUtils annotation cache.
> ------------------------------------------
>
> Key: NIFI-15388
> URL: https://issues.apache.org/jira/browse/NIFI-15388
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Bob Paulin
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> When org.apache.nifi.util.ReflectionUtils invoke methods are called annotations are cached in a WeakHashMap. While keys (Class) in the WeakHashMap are weak references the values (Methods) are strong references. The classes can not then be garbaged collected because the Methods have a reference to there class.
>
> So the values that are added to the cache should also be wrapped in a WeakReference. Then the classes can be garbage collected.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)