Interface MemoryMeterListener

All Known Implementing Classes:
NoopMemoryMeterListener, TreePrinter

public interface MemoryMeterListener
Listener that receive notification form MemoryMeter.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A factory for MemoryMeterListener.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    arrayElementAdded(Object[] array, int index, Object elementValue)
    Notification that the element from the specified array has been added.
    void
    Notification that the size of the remaining bytes of a ByteBuffer have been measured.
    void
    done(long size)
    Notification that the entire graph has been measured.
    void
    failedToAccessField(Object obj, String fieldName, Class<?> fieldType)
    Notification that the graph could not be fully measured has it failed to access a field.
    void
    fieldAdded(Object obj, String fieldName, Object fieldValue)
    Notification that the field from the specified object has been added.
    void
    objectMeasured(Object current, long size)
    Notification that the size of the specified object has been measured.
    void
    Notification that MemoryMeter as started analyzing the specified object.
  • Method Details

    • started

      void started(Object obj)
      Notification that MemoryMeter as started analyzing the specified object.
      Parameters:
      obj - the object being analyzed
    • fieldAdded

      void fieldAdded(Object obj, String fieldName, Object fieldValue)
      Notification that the field from the specified object has been added.
      Parameters:
      obj - the object for which a field has been added
      fieldName - the field name
      fieldValue - the field value
    • arrayElementAdded

      void arrayElementAdded(Object[] array, int index, Object elementValue)
      Notification that the element from the specified array has been added.
      Parameters:
      array - the array for which an element has been added
      index - the element index
      elementValue - the element value
    • objectMeasured

      void objectMeasured(Object current, long size)
      Notification that the size of the specified object has been measured.
      Parameters:
      current - the object that has been measured
      size - the object size in bytes
    • byteBufferRemainingMeasured

      void byteBufferRemainingMeasured(ByteBuffer buffer, long size)
      Notification that the size of the remaining bytes of a ByteBuffer have been measured.
      Parameters:
      buffer - the ByteBuffer
      size - the remaining bytes
    • done

      void done(long size)
      Notification that the entire graph has been measured.
      Parameters:
      size - the size of the entire graph.
    • failedToAccessField

      void failedToAccessField(Object obj, String fieldName, Class<?> fieldType)
      Notification that the graph could not be fully measured has it failed to access a field.
      Parameters:
      obj - the object owning the field that could not be accessed
      fieldName - the field name
      fieldType - the field type