hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yu Sun (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-16300) LruBlockCache.CACHE_FIXED_OVERHEAD should calculate LruBlockCache size correctly
Date Thu, 28 Jul 2016 18:55:20 GMT

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

Yu Sun updated HBASE-16300:
---------------------------
    Description: 
in current master {{LruBlockCache}},  CACHE_FIXED_OVERHEAD is calculated as this:
{code}
  public final static long CACHE_FIXED_OVERHEAD = ClassSize.align(
      (3 * Bytes.SIZEOF_LONG) + (10 * ClassSize.REFERENCE) +
      (5 * Bytes.SIZEOF_FLOAT) + (2 * Bytes.SIZEOF_BOOLEAN)
      + ClassSize.OBJECT);
{code}

after some investigation. I think there are some wrong here, {{class LruBlockCache}}, except
static varible(which is belongs to class), there are 4 long varibles(maxBlockSize,maxSize,blockSize
and overhead), 9 reference varibles and 2 boolean varibles, so the above code will not calculate
LruBlockCache instance size correctly.

current related ut not failed mostly due to the result is 8 bytes aligned.

  was:
in current master {{LruBlockCache}},  CACHE_FIXED_OVERHEAD is calculated as this:
{code}
  public final static long CACHE_FIXED_OVERHEAD = ClassSize.align(
      (3 * Bytes.SIZEOF_LONG) + (10 * ClassSize.REFERENCE) +
      (5 * Bytes.SIZEOF_FLOAT) + (2 * Bytes.SIZEOF_BOOLEAN)
      + ClassSize.OBJECT);
{code}

after some investigation. I think there are some wrong here, {{class LruBlockCache}}, except
static varible(which is belongs to class), there are 4 long varibles(maxBlockSize,maxSize,blockSize
and overhead), 9 reference varibles and 2 boolean varibles, so the above code will not calculate
LruBlockCache instance size correctly.


> LruBlockCache.CACHE_FIXED_OVERHEAD should calculate LruBlockCache size correctly
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-16300
>                 URL: https://issues.apache.org/jira/browse/HBASE-16300
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Yu Sun
>            Assignee: Yu Sun
>
> in current master {{LruBlockCache}},  CACHE_FIXED_OVERHEAD is calculated as this:
> {code}
>   public final static long CACHE_FIXED_OVERHEAD = ClassSize.align(
>       (3 * Bytes.SIZEOF_LONG) + (10 * ClassSize.REFERENCE) +
>       (5 * Bytes.SIZEOF_FLOAT) + (2 * Bytes.SIZEOF_BOOLEAN)
>       + ClassSize.OBJECT);
> {code}
> after some investigation. I think there are some wrong here, {{class LruBlockCache}},
except static varible(which is belongs to class), there are 4 long varibles(maxBlockSize,maxSize,blockSize
and overhead), 9 reference varibles and 2 boolean varibles, so the above code will not calculate
LruBlockCache instance size correctly.
> current related ut not failed mostly due to the result is 8 bytes aligned.



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

Mime
View raw message