Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-3748

Consider reusing bytebuffer in FilePerBlockStrategy::readChunk

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      https://github.com/apache/hadoop-ozone/blob/master/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/FilePerBlockStrategy.java#L148

       

                  long len = info.getLen();            
                  long offset = info.getOffset();
                  ByteBuffer data = ByteBuffer.allocate((int) len);
                  ChunkUtils.readData(chunkFile, data, offset, len, volumeIOStats); 
      

       

      Instead of allocating buffer in every readChunk, it may be possible to reuse via threadLocal ByteBuffer. Sizes/Limits could be adjusted on need basis.

      This is to reduce memory pressure on DN.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rajesh.balamohan Rajesh Balamohan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: