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

SSTableMetadata.min(max)ColumnNames keep whole SlabAllocatior region referenced; wasting memory

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 2.0.2
    • Component/s: None
    • Labels:
      None
    • Severity:
      Normal
    • Since Version:

      Description

      .. which could be a problem when there is a lot of sstables, when using LCS for example.

      SSTableWriter calls SSTableMetadata.Collector.updateMin(Max)ColumnNames passing List of ByteByffers which reference a small byte array in slab region.
      ColumnNameHelper.mergeMin(Max) just returns a reference of column name back to SSTableMetadata. So the latter keeps whole slab region referenced, preventing it from being GCed.

      Fixed it by making copies of column name bytebuffer, if its size more than column name itself.

        Attachments

        1. ColumnNameHelper.diff
          4 kB
          Oleg Anastasyev

          Activity

            People

            • Assignee:
              m0nstermind Oleg Anastasyev
              Reporter:
              m0nstermind Oleg Anastasyev
              Authors:
              Oleg Anastasyev
              Reviewers:
              Jonathan Ellis
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: