Class DirectByteBufferPool$

java.lang.Object
org.apache.pekko.io.DirectByteBufferPool$

public class DirectByteBufferPool$ extends Object
INTERNAL API
  • Field Details

    • MODULE$

      public static final DirectByteBufferPool$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • DirectByteBufferPool$

      public DirectByteBufferPool$()
  • Method Details

    • tryCleanDirectByteBuffer

      public void tryCleanDirectByteBuffer(ByteBuffer byteBuffer)
      DirectByteBuffers are garbage collected by using a phantom reference and a reference queue. Every once a while, the JVM checks the reference queue and cleans the DirectByteBuffers. However, as this doesn't happen immediately after discarding all references to a DirectByteBuffer, it's easy to OutOfMemoryError yourself using DirectByteBuffers. This function explicitly calls the Cleaner method of a DirectByteBuffer.