[
https://issues.apache.org/jira/browse/HIVE-17344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16135009#comment-16135009
]
Janos Gub commented on HIVE-17344:
----------------------------------
Sorry my bad. So when bytebuffers sliced position and limit will be set in a
way that remaining returns the size of the slice. If there are overlapped
slices it will be counted twice, but capacity would not help in this case
neither.
> LocalCache element memory usage is not calculated properly.
> -----------------------------------------------------------
>
> Key: HIVE-17344
> URL: https://issues.apache.org/jira/browse/HIVE-17344
> Project: Hive
> Issue Type: Bug
> Reporter: Janos Gub
> Assignee: Janos Gub
> Attachments: HIVE-17344.patch
>
>
> Orc footer cache has a calculation of memory usage:
> {code:java}
> public int getMemoryUsage() {
> return bb.remaining() + 100; // 100 is for 2 longs, BB and java overheads
> (semi-arbitrary).
> }
> {code}
> ByteBuffer.remaining returns the remaining space in the bytebuffer, thus
> allowing this cache have elements MAXWEIGHT/100 of arbitrary size. I think
> the correct solution would be bb.capacity.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)