Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to enforce a variable on custom NiFi processor to not be picked up by Garbage Collector?

Highlighted

How to enforce a variable on custom NiFi processor to not be picked up by Garbage Collector?

New Contributor

Hi all,

I have a custom processor which has variable that holds a map of <String, Object>. While this processor is running, it uses this map to improve the performance by using the Object that is stored within this map given the key. If there's no such Object found, it will create the new Object and update the map.

My goal is to keep this map from being collected by the GC until NiFi service is restarted or it runs out of memory. Does anybody know whether we have a way to do that and how can we test it?

Thanks.

Don't have an account?
Coming from Hortonworks? Activate your account here