Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-14832

BufferPool: allocating thread for new chunks should acquire directly

    XMLWordPrintableJSON

    Details

      Description

      When BufferPool does not have any free Chunks to satisfy a request, the calling thread allocates a new large block of memory which it breaks up into chunks and adds to the free chunks queue, then pulls from the queue to satisfy it's own allocation.

      If enough other threads request chunks it is possible for the queue to be exhausted before the original allocating thread is able to pull of it's own allocation, causing the original allocator to loop and attempt to allocate more memory.  This is unfair to the original caller and may cause it to block on a system call to allocate more memory.

      Instead of the current behavior, allocateMoreChunks could hold back one of the chunks and return it to the caller instead so that it will at most call allocate once.

       

        Attachments

          Activity

            People

            • Assignee:
              jmeredithco Jon Meredith
              Reporter:
              jmeredithco Jon Meredith
              Authors:
              Jon Meredith
              Reviewers:
              Benedict Elliott Smith
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: