Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-2679

Optimize memory usage in JavaBinCodec.readStr()

    Details

      Description

      In Solr 3.3, JavaBinCodec.readStr() reads complete string into byte[] and then converts it into String. FastInputStream is already buffered, so this it not necessary and may take a lot of memory if data string is large.

      This patch replaces usage of big byte[] with usage of dis.readUnsignedByte() for getting characters directly from stream.

      Patch reduces memory usage and may slightly improve performance of reading text data in javabin-codec.

      JavaBinCodec.readStr() function already has unit test in TestJavaBinCodec, no additional unit test is required.

        Attachments

        1. SOLR-2679.patch
          2 kB
          Maxim Valyanskiy

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              maxim.valyanskiy Maxim Valyanskiy
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: