Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-14598

ByteBufferOutputStream grows its HeapByteBuffer beyond JVM limitations

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      We noticed that in returning a Scan against a region containing particularly large (wide) rows that it is possible during ByteBufferOutputStream.checkSizeAndGrow() to attempt to create a new ByteBuffer larger than the JVM allows which then throws a OutOfMemoryError. The code currently caps it at Integer.MAX_VALUE which is actually larger than the JVM allows. This lead to us dealing with cascading region server death as the RegionServer hosting the region died, opened on a new server, the client retried the scan, and the new RS died as well.

      I believe ByteBufferOutputStream should not try to create ByteBuffers that large and instead throw an exception back up if it needs to grow any bigger. The limit should probably be something like Integer.MAX_VALUE-8, as that is what ArrayList uses. ref: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/util/ArrayList.java#221

      Attachments

        1. 14598.txt
          0.9 kB
          Michael Stack
        2. hbase-14598-v1.patch
          4 kB
          Michael Stack
        3. hbase-14598-v1.patch
          4 kB
          Michael Stack
        4. hbase-14598-v1.patch
          4 kB
          Ian Friedman
        5. hbase-14598-v1 (1).patch
          4 kB
          Michael Stack

        Activity

          People

            ianfriedman Ian Friedman
            ianfriedman Ian Friedman
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: