Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-1098

N1qlQueryExecutor is allocating twice the memory it needs

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 2.5.0
    • 2.4.7
    • N1QL
    • java 8

    Description

      When the netty ByteBuf is not backed by a byte array.
      N1qlQueryExecutor#executeQuery is allocating the byte array twice.

      • the first time in TranscoderUtils#byteBufToByteArray
      • the second with Arrays#copyOfRange

      a specialized version of TranscoderUtils#byteBufToByteArray should be created that will only call Arrays#copyOfRange if the ByteBuf is backed by a byte array.

      A hackish implementation tested in our environment reduced our n1ql memory allocation by 50% !

      Attachments

        For Gerrit Dashboard: JCBC-1098
        # Subject Branch Project Status CR V

        Activity

          People

            daschl Michael Nitschinger
            benoit.wiart Benoit Wiart
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty