Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-204

BoundedByteBufferReceive hides OutOfMemoryError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.7
    • 0.7.1
    • None
    • None

    Description

      private def byteBufferAllocate(size: Int): ByteBuffer = {
      var buffer: ByteBuffer = null
      try

      { buffer = ByteBuffer.allocate(size) }

      catch

      { case e: OutOfMemoryError => throw new RuntimeException("OOME with size " + size, e) case e2 => throw e2 }

      buffer
      }

      This hides the fact that an Error occurred, and will likely result in some log handler printing a message, instead of exiting with non-zero status. Knowing how large the allocation was that caused an OOM is really nice, so I'd suggest logging in byteBufferAllocate and then re-throwing OutOfMemoryError

      Attachments

        1. k204-v1.txt
          0.7 kB
          Chris Burroughs

        Activity

          People

            cburroughs Chris Burroughs
            cburroughs Chris Burroughs
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: