Class MemoryPool

java.lang.Object
io.trino.memory.MemoryPool

public class MemoryPool extends Object
  • Constructor Details

    • MemoryPool

      public MemoryPool(io.airlift.units.DataSize size)
  • Method Details

    • getInfo

      public MemoryPoolInfo getInfo()
    • addListener

      public void addListener(MemoryPoolListener listener)
    • removeListener

      public void removeListener(MemoryPoolListener listener)
    • reserve

      public com.google.common.util.concurrent.ListenableFuture<Void> reserve(TaskId taskId, String allocationTag, long bytes)
      Reserves the given number of bytes. Caller should wait on the returned future, before allocating more memory.
    • reserveRevocable

      public com.google.common.util.concurrent.ListenableFuture<Void> reserveRevocable(TaskId taskId, long bytes)
    • tryReserve

      public boolean tryReserve(TaskId taskId, String allocationTag, long bytes)
      Try to reserve the given number of bytes. Return value indicates whether the caller may use the requested memory.
    • tryReserveRevocable

      public boolean tryReserveRevocable(long bytes)
    • free

      public void free(TaskId taskId, String allocationTag, long bytes)
    • freeRevocable

      public void freeRevocable(TaskId taskId, long bytes)
    • freeRevocable

      public void freeRevocable(long bytes)
    • getFreeBytes

      public long getFreeBytes()
      Returns the number of free bytes. This value may be negative, which indicates that the pool is over-committed.
    • getMaxBytes

      public long getMaxBytes()
    • getReservedBytes

      public long getReservedBytes()
    • getReservedRevocableBytes

      public long getReservedRevocableBytes()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getQueryMemoryReservations

      public Map<QueryId,Long> getQueryMemoryReservations()
    • getTaggedMemoryAllocations

      public Map<QueryId,Map<String,Long>> getTaggedMemoryAllocations()
    • getQueryRevocableMemoryReservations

      public Map<QueryId,Long> getQueryRevocableMemoryReservations()
    • getTaskMemoryReservations

      public Map<TaskId,Long> getTaskMemoryReservations()
    • getTaskRevocableMemoryReservations

      public Map<TaskId,Long> getTaskRevocableMemoryReservations()