You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Lars Hofhansl (JIRA)" <ji...@apache.org> on 2016/06/16 06:57:05 UTC

[jira] [Updated] (PHOENIX-3000) Reduce memory consumption during DISTINCT aggregation

     [ https://issues.apache.org/jira/browse/PHOENIX-3000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Hofhansl updated PHOENIX-3000:
-----------------------------------
    Attachment: 3000.txt

Here's a simple fix. Copy the key, unless it occupies more than 10% of the array handed to us. Or in other words, if we can save 90% of HEAP during aggregate we'll take the hit of making the copy.

In some tests I ran that made the difference between finishing and simply running out of memory.

Note that it is not quite as simple. If the block is cached in HBase anyway - and we're not using BLOCK_ENCODING - we would not consume more memory since we made a copy, but the block is on the heap anyway.


> Reduce memory consumption during DISTINCT aggregation
> -----------------------------------------------------
>
>                 Key: PHOENIX-3000
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3000
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>         Attachments: 3000.txt
>
>
> In {{DistinctValueWithCountServerAggregator.aggregate}} we hold on the ptr handed to us from HBase.
> Note that this pointer points into an HFile Block, and hence we hold onto the entire block for the duration of the aggregation.
> If the column has high cardinality we might attempt holding the entire table in memory in the extreme case.



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