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

Investigate initial size of GrowableByteArrayDataOutput in RAMIndexOutput

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Normal
    • Resolution: Won't Fix
    • None
    • Feature/SAI
    • None

    Description

      The GrowableByteArrayDataOutput in RAMIndexOutput is currently initialized with a size of 128 bytes. There is no explanation as to why this size was chosen.

      The GrowableByteArrayDataOutput does not lazily allocate memory but only ever allocates enough for each write operation. This can lead to a lot of fresh allocations and calls to System.arrayCopy.

      Since RAMIndexOutput is used to build the on-disk postings in SAI it is likely that the size of the in-memory array is going to grow considerably more that 128 bytes.

      We should investigate changing this initial value to something higher and possibly changing the GrowableByteArrayDataOutput class to allocate in blocks rather than write increments.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mike_tr_adamson Mike Adamson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: