Madhan Neethiraj created RANGER-4787:
----------------------------------------

             Summary: reduce plugin memory footprint by avoiding creation of 
unnecessary collections
                 Key: RANGER-4787
                 URL: https://issues.apache.org/jira/browse/RANGER-4787
             Project: Ranger
          Issue Type: Improvement
          Components: plugins
            Reporter: Madhan Neethiraj
            Assignee: Madhan Neethiraj


Model package classes like RangerPolicy initialize collection members with a 
new collection object (ArrayList/HashMap/HashSet). Many of these members would 
likely remain empty, resulting in the initialization to be unnecessary. Instead 
of creating a new collection object, it will help to initialize with 
Collections.emptyList()/emptySet()/emptyMap() - to save memory while retaining 
non-null value for collection members.

Also, set() on these members currently create a new collection object with a 
copy of the value to be set. This can be avoided by using the given value.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to