Class NettyAllocationManager


public class NettyAllocationManager extends AllocationManager
The default implementation of AllocationManager. The implementation is responsible for managing when memory is allocated and returned to the Netty-based PooledByteBufAllocatorL.
  • Field Details


      public static final AllocationManager.Factory FACTORY

      public static final int DEFAULT_ALLOCATION_CUTOFF_VALUE
      The default cut-off value for switching allocation strategies. If the request size is not greater than the cut-off value, we will allocate memory by PooledByteBufAllocatorL APIs, otherwise, we will use PlatformDependent APIs.
      See Also:
  • Method Details

    • memoryAddress

      protected long memoryAddress()
      Description copied from class: AllocationManager
      Return the absolute memory address pointing to the fist byte of underlying memory chunk.
      Specified by:
      memoryAddress in class AllocationManager
    • release0

      protected void release0()
      Description copied from class: AllocationManager
      Release the underlying memory chunk.
      Specified by:
      release0 in class AllocationManager
    • getSize

      public long getSize()
      Returns the underlying memory chunk size managed.

      NettyAllocationManager rounds requested size up to the next power of two.

      Specified by:
      getSize in class AllocationManager
      size of underlying memory chunk