[ 
https://issues.apache.org/jira/browse/HIVE-20509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16612987#comment-16612987
 ] 

Gopal V commented on HIVE-20509:
--------------------------------

[~b.maidics]: You are right, my calculation is wrong - I'm assuming the whole 
entry can be skipped (so 72 is what we save).

However, now that I think about it a bit more, I can't see why we end up with 
thousands of identical arraylist objects - we can generate default 1 element 
list for each alias with a CopyOnWriteArrayList() & save more space for large 
partitioned tables.



> Plan: fix wasted memory in plans with large partition counts
> ------------------------------------------------------------
>
>                 Key: HIVE-20509
>                 URL: https://issues.apache.org/jira/browse/HIVE-20509
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>            Reporter: Gopal V
>            Assignee: Barnabas Maidics
>            Priority: Minor
>              Labels: newbie
>         Attachments: HIVE-20509.2.patch, HIVE-20509.patch, after.png, 
> before.png
>
>
> {code}
>   public void addPathToAlias(Path path, String newAlias){
>     ArrayList<String> aliases = pathToAliases.get(path);
>     if (aliases == null) {
>       aliases = new ArrayList<>();
>       StringInternUtils.internUriStringsInPath(path);
>       pathToAliases.put(path, aliases);
>     }
>     aliases.add(newAlias.intern());
>   }
> {code}
> ArrayList::DEFAULT_CAPACITY is 10, so this wastes 500 bytes of memory due to 
> the {{new ArrayList<>();}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to