Open zinking opened 1 year ago
If I remember correctly memoryPool
is for allocating native data buffers for this dataset.
allocator
doesn't actually allocate memory for data, but will take ownership of the buffers allocated by memoryPool
while the buffers are transferred to Java side.
If I remember correctly
memoryPool
is for allocating native data buffers for this dataset.
allocator
doesn't actually allocate memory for data, but will take ownership of the buffers allocated bymemoryPool
while the buffers are transferred to Java side.
@zhztheplayer are there actual usages that I can refer to. allocator
usage still sounds abstract.
actually let me put it this way
public BaseAllocator defaultAllocator() {
NativeSQLMemoryConsumer consumer =
new NativeSQLMemoryConsumer(taskMemoryManager, offHeapMemory);
SparkAllocationListener al = new SparkAllocationListener(consumer);
RootAllocator parent = ArrowDatasetUtil.rootAllocator();
String name = "Spark Managed Allocator - " + UUID.randomUUID();
return (BaseAllocator) parent.newChildAllocator(name, al, 0, parent.getLimit());
}
public NativeMemoryPool defaultMemoryPool() {
NativeSQLMemoryConsumer consumer =
new NativeSQLMemoryConsumer(taskMemoryManager, offHeapMemory);
SparkReservationListener rl = new SparkReservationListener(consumer);
return NativeMemoryPool.createListenable(rl);
}
should the two use the same MemoryConsumer, or the allocator doesn't use memoryConsumer at all? here the NativeSQLMemoryConsumer is basically the same as MemoryConsumer.
@zhztheplayer
Describe the usage question you have. Please include as many useful details as possible.
@zhztheplayer
what's the relationship between allocator and memoryPool, does allocator allocate buffers from the memory pool or there is no such restrictions?
thanks
Component(s)
Java