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
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.7
    • 2.5.0
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        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