Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-16300

LruBlockCache.CACHE_FIXED_OVERHEAD should calculate LruBlockCache size correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0, 0.98.21, 1.2.3, 2.0.0
    • None
    • None

    Description

      in current master LruBlockCache, CACHE_FIXED_OVERHEAD is calculated as this:

        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);
      

      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.

      Attachments

        1. HBASE-16300-v1.patch
          0.7 kB
          Yu Sun

        Issue Links

          Activity

            People

              haoran Yu Sun
              haoran Yu Sun
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: