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

zhangduo commented on HBASE-12463:
----------------------------------

I think we need to add "Do not cache return value" to the document of 
allocateBytes if we really want to do this...

People usually do not think the second call to a method will change the return 
value of first call, such as the testcase you modified...

> MemstoreLAB reduce #objects created
> -----------------------------------
>
>                 Key: HBASE-12463
>                 URL: https://issues.apache.org/jira/browse/HBASE-12463
>             Project: HBase
>          Issue Type: Improvement
>          Components: Performance
>    Affects Versions: 0.99.0
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 2.0.0, 0.99.2
>
>         Attachments: HBASE-12463.patch
>
>
> By default Memstore uses MSLAB. For each of the Cell added to memstore, we 
> will allocate area in MSLAB and return the area in BR wrapper. So each time a 
> new BR object is created. Instead of this we can have ThreadLocal level BR 
> instance and each time when allocate() API return the BR, we can set the 
> byte[], offset, length on this ThreadLocal level BR instance. So totally only 
> those many objects as the threads count (max handler count)



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

Reply via email to