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

Possible memory leak in BucketCache

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.1, 1.1.0, 0.98.13, 2.0.0
    • BlockCache
    • None
    • Reviewed

    Description

      BucketCache.java
      public boolean evictBlock(BlockCacheKey cacheKey) {
            ...
            if (bucketEntry.equals(backingMap.remove(cacheKey))) {
              bucketAllocator.freeBlock(bucketEntry.offset());
              realCacheSize.addAndGet(-1 * bucketEntry.getLength());
              blocksByHFile.remove(cacheKey.getHfileName(), cacheKey);
              if (removedBlock == null) {
                this.blockNumber.decrementAndGet();
              }
            } else {
              return false;
            }
            ...
      

      I think the problem is here. We remove a BucketEntry that should not be removed by us, but we do not put it back and also do not do any clean up.

      Attachments

        1. HBASE-13301-testcase.patch
          6 kB
          Duo Zhang
        2. HBASE-13301-testcase_v1.patch
          8 kB
          Duo Zhang
        3. HBASE-13301-branch-1.patch
          25 kB
          Duo Zhang
        4. HBASE-13301-branch-1.0.patch
          25 kB
          Duo Zhang
        5. HBASE-13301-branch-1.0.patch
          25 kB
          Duo Zhang
        6. HBASE-13301-branch-1.0_v1.patch
          28 kB
          Duo Zhang
        7. HBASE-13301-branch-1_v1.patch
          28 kB
          Duo Zhang
        8. HBASE-13301-0.98.patch
          25 kB
          Duo Zhang
        9. HBASE-13301-0.98_v1.patch
          28 kB
          Duo Zhang
        10. HBASE-13301.patch
          15 kB
          Duo Zhang
        11. HBASE-13301_v3.patch
          28 kB
          Duo Zhang
        12. HBASE-13301_v2.patch
          25 kB
          Duo Zhang
        13. HBASE-13301_v1.patch
          19 kB
          Duo Zhang

        Issue Links

          Activity

            People

              zhangduo Duo Zhang
              zhangduo Duo Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: