HeapPooledPageAllocator

cc.otavia.buffer.pool.HeapPooledPageAllocator
class HeapPooledPageAllocator(fixedCapacity: Int, minCache: Int, maxCache: Int) extends AbstractPooledPageAllocator

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Show all

Members list

Value members

Constructors

def this()

Concrete methods

override def isDirect: Boolean

Determine if this allocator is allocate direct memory or heap memory.

Determine if this allocator is allocate direct memory or heap memory.

Attributes

Returns

true if this allocator is direct, false otherwise.

Definition Classes

Inherited methods

override def allocate(): RecyclablePageBuffer

Attributes

Definition Classes
Inherited from:
AbstractPooledPageAllocator
override def allocate(size: Int): RecyclablePageBuffer

Allocate a Buffer of the given size in bytes. This method may throw an OutOfMemoryError if there is not enough free memory available to allocate a Buffer of the requested size.

Allocate a Buffer of the given size in bytes. This method may throw an OutOfMemoryError if there is not enough free memory available to allocate a Buffer of the requested size.

The buffer will use big endian byte order.

Note: unlike the JDK ByteBuffers, Netty Buffers are not guaranteed to be zeroed when allocated. In other words, the memory of a newly allocated buffer may contain garbage data from prior allocations, and the memory is likewise not guaranteed to be erased when the buffer is closed. If the data is sensitive and needs to be overwritten when the buffer is closed, then the buffer should be allocated with the SensitiveBufferAllocator.

Attributes

Returns

The newly allocated Buffer.

Throws
IllegalStateException

if this allocator has been closed.

Definition Classes
Inherited from:
PooledPageAllocator
override def cacheSize: Int

Attributes

Definition Classes
Inherited from:
AbstractPooledPageAllocator
override def isPooling: Boolean

Determine if this allocator is pooling and reusing its allocated memory.

Determine if this allocator is pooling and reusing its allocated memory.

Attributes

Returns

true if this allocator is pooling and reusing its memory, false otherwise.

Definition Classes
Inherited from:
AbstractPooledPageAllocator
override def recycle(buffer: Buffer): Unit

Recycle the Buffer

Recycle the Buffer

Attributes

Definition Classes
Inherited from:
AbstractPooledPageAllocator
def releasable: Boolean

Attributes

Inherited from:
AbstractPooledPageAllocator
override def release(): Unit

Release the allocated cache buffer to minCache size.

Release the allocated cache buffer to minCache size.

Attributes

Definition Classes
Inherited from:
AbstractPooledPageAllocator
override def releaseAll(): Unit

Release all the allocated cache buffers.

Release all the allocated cache buffers.

Attributes

Definition Classes
Inherited from:
AbstractPooledPageAllocator
override def totalAllocated: Int

Attributes

Definition Classes
Inherited from:
AbstractPooledPageAllocator