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

Yi Liu commented on HDFS-8900:
------------------------------

This optimization:
-   For each XAttr, can save: 12bytes (object overhead) + 2bytes (compact), 
memory alignment of value
-   For each XAttrFeature, can save: 12 bytes (object overhead) + num * XAttr 
saved.

So for each XAttrFeature (associated with an INodeFile or INodeDirectory), we 
can save (bytes): 12 + n * (14 + memory alignment of value in each XAttr) 


The patch also makes code logic more simper, and has no impact on NN 
performance.

Besides, the xattrMaxSize is used to restrict user/trust namespace xattrs, I 
add a hard limit for max size. It's reasonable and make Xattr more 
controllable. 

> Optimize XAttr memory footprint.
> --------------------------------
>
>                 Key: HDFS-8900
>                 URL: https://issues.apache.org/jira/browse/HDFS-8900
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>            Reporter: Yi Liu
>            Assignee: Yi Liu
>         Attachments: HDFS-8900.001.patch
>
>
> {code}
> private final ImmutableList<XAttr> xAttrs;
> {code}
> Currently we use above in XAttrFeature, it's not efficient from memory point 
> of view, since {{ImmutableList}} and {{XAttr}} have object memory overhead, 
> and each object has memory alignment. 
> We can use a {{byte[]}} in XAttrFeature and do some compact in {{XAttr}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to