Cassandra
  1. Cassandra
  2. CASSANDRA-6077

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

    Details

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

      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.

        Activity

        Oleg Anastasyev created issue -
        Oleg Anastasyev made changes -
        Field Original Value New Value
        Attachment ColumnNameHelper.diff [ 12604551 ]
        Oleg Anastasyev made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Oleg Anastasyev made changes -
        Attachment ColumnNameHelper.diff [ 12604551 ]
        Oleg Anastasyev made changes -
        Attachment ColumnNameHelper.diff [ 12604566 ]
        Hide
        Jonathan Ellis added a comment -

        Nice catch; committed.

        Show
        Jonathan Ellis added a comment - Nice catch; committed.
        Jonathan Ellis made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Assignee Oleg Anastasyev [ m0nstermind ]
        Reviewer jbellis
        Fix Version/s 2.0.2 [ 12325023 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development