Enum Class MemoryMeter.ByteBufferMode

java.lang.Object
java.lang.Enum<MemoryMeter.ByteBufferMode>
org.github.jamm.MemoryMeter.ByteBufferMode
All Implemented Interfaces:
Serializable, Comparable<MemoryMeter.ByteBufferMode>, Constable
Enclosing class:
MemoryMeter

public static enum MemoryMeter.ByteBufferMode extends Enum<MemoryMeter.ByteBufferMode>
The different way of measuring deeply a ByteBuffer.
  • Enum Constant Details

    • NORMAL

      public static final MemoryMeter.ByteBufferMode NORMAL
      Default mode, measure the ByteBuffer and all of its children
    • SLAB_ALLOCATION_NO_SLICE

      public static final MemoryMeter.ByteBufferMode SLAB_ALLOCATION_NO_SLICE
      Mode used to handle SLAB allocated ByteBuffers, without slices, where the overhead amortized over all the allocations is negligible and we prefer to undercount than over count.
    • SLAB_ALLOCATION_SLICE

      public static final MemoryMeter.ByteBufferMode SLAB_ALLOCATION_SLICE
      Mode used to handle SLAB allocated ByteBuffers, with slices, where the overhead amortized over all the allocations is negligible and we prefer to undercount than over count.
  • Method Details

    • values

      public static MemoryMeter.ByteBufferMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MemoryMeter.ByteBufferMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isSlab

      public abstract boolean isSlab(ByteBuffer buffer)
      Checks if this buffer can be considered as a SLAB according to this mode.
      Parameters:
      buffer - the buffer to check.
      Returns:
      true if this buffer can be considered as a SLAB according to this mode, false otherwise.