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

DataOutputBuffer#scratchBuffer can use off-heap or on-heap memory as a means to control memory allocations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 5.0-alpha1, 5.0
    • Local/Caching
    • None

    Description

      While running workflows to compare 3.0 with trunk we found that allocations and GC are significantly higher for a write mostly workload (22% read, 3% delete, 75% write); below is what we saw for a 2h run

      Allocations
      30: 1.64TB
      40: 2.99TB

      GC Events
      30: 7.39k events
      40: 13.93k events

      When looking at the allocation output we saw the follow for memory allocations

      Here we see that org.apache.cassandra.io.util.DataOutputBuffer#expandToFit is around 52% of the memory allocations. When looking at this logic I see that allocations are on-heap and constantly throw away the buffer (as a means to allow GC to clean up).

      With the patch, allocations/gc are the following

      Allocations
      30: 1.64TB
      40 w/ patch: 1.77TB
      40: 2.99TB

      GC Events
      30: 7.39k events
      40 w/ patch: 8k events
      40: 13.93k events

      With the patch only 0.8% allocations

      Attachments

        1. Screen Shot 2021-02-25 at 3.34.28 PM.png
          1.15 MB
          David Capwell
        2. Screen Shot 2021-02-25 at 4.14.19 PM.png
          1.32 MB
          David Capwell

        Activity

          People

            dcapwell David Capwell
            dcapwell David Capwell
            David Capwell
            Caleb Rackliffe
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 40m
                1h 40m