Interface HostMemoryAllocator

All Known Implementing Classes:
DefaultHostMemoryAllocator

public interface HostMemoryAllocator
  • Method Summary

    Modifier and Type
    Method
    Description
    allocate(long bytes)
    Allocate memory, but be sure to close the returned buffer to avoid memory leaks.
    allocate(long bytes, boolean preferPinned)
    Allocate memory, but be sure to close the returned buffer to avoid memory leaks.
  • Method Details

    • allocate

      HostMemoryBuffer allocate(long bytes, boolean preferPinned)
      Allocate memory, but be sure to close the returned buffer to avoid memory leaks.
      Parameters:
      bytes - size in bytes to allocate
      preferPinned - If set to true, the pinned memory pool will be used if possible with a fallback to off-heap memory. If set to false, the allocation will always be from off-heap memory.
      Returns:
      the newly created buffer
    • allocate

      HostMemoryBuffer allocate(long bytes)
      Allocate memory, but be sure to close the returned buffer to avoid memory leaks. Pinned memory for allocations preference is up to the implementor
      Parameters:
      bytes - size in bytes to allocate
      Returns:
      the newly created buffer