-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Labels
good first issueGood for newcomersGood for newcomers
Milestone
Description
Describe the bug, including details regarding any error messages, version, and platform.
The following snippet
package org.apache.arrow.vector;
import org.apache.arrow.memory.ArrowBuf;
import org.apache.arrow.memory.RootAllocator;
import org.junit.jupiter.api.Test;
public class BufferAllocatorOverAllocation {
@Test
void overallocation() {
RootAllocator allocator = new RootAllocator();
ArrowBuf buf = allocator.buffer(9946);
System.out.println(buf.capacity());
buf.capacity(9946);
System.out.println(buf.capacity());
}
}prints
16384
9946
So without setting the capacity explicitly the allocator overallocates memory and also seems to set the capacity of the buffer to that. That is contrary to the docstring of the buffer method:
Note that the buffer may technically be larger than the requested size for rounding purposes. However, the buffer's capacity will be set to the configured size.
Tested against the 14.0.2 tag.
Component(s)
Java
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers