Class AllocationManager

java.lang.Object
org.apache.drill.exec.memory.AllocationManager

public class AllocationManager extends Object
Manages the relationship between one or more allocators and a particular UDLE. Ensures that one allocator owns the memory that multiple allocators may be referencing. Manages a BufferLedger between each of its associated allocators. This class is also responsible for managing when memory is allocated and returned to the Netty-based {code PooledByteBufAllocatorL}.

The only reason that this isn't package private is we're forced to put DrillBuf in Netty's package which need access to these objects or methods.

Threading: AllocationManager manages thread-safety internally. Operations within the context of a single BufferLedger are lockless in nature and can be leveraged by multiple threads. Operations that cross the context of two ledgers will acquire a lock on the AllocationManager instance. Important note, there is one AllocationManager per UnsafeDirectLittleEndian buffer allocation. As such, there will be thousands of these in a typical query. The contention of acquiring a lock on AllocationManager should be very low.

  • Method Details

    • chunkSize

      public static int chunkSize()