Class MemoryUsage

java.lang.Object
org.apache.datafusion.MemoryUsage

public final class MemoryUsage extends Object
Snapshot of session-wide memory usage from SessionContext.memoryUsage(). Returns the total bytes currently reserved against the session's MemoryPool and the peak observed since the session was created.

Multi-tenant attribution: place each tenant in its own SessionContext. Sessions in DataFusion are cheap; one per tenant is the standard pattern. Within a single session, the snapshot is the sum across all in-flight queries' operator reservations -- see SessionContext.memoryUsage() for the precise definition of what is and is not counted.

Instances are immutable.

  • Constructor Details

    • MemoryUsage

      public MemoryUsage(long currentBytes, long peakBytes)
  • Method Details

    • currentBytes

      public long currentBytes()
      Bytes currently reserved against this session's MemoryPool.
    • peakBytes

      public long peakBytes()
      Maximum value of currentBytes() observed since the session was created. Monotonic: never decreases for a given session.
    • toString

      public String toString()
      Overrides:
      toString in class Object