liyafan82 commented on a change in pull request #6323:
URL: https://github.com/apache/arrow/pull/6323#discussion_r414330471



##########
File path: 
java/memory/src/main/java/org/apache/arrow/memory/NettyAllocationManager.java
##########
@@ -34,31 +33,34 @@
   static final UnsafeDirectLittleEndian EMPTY = INNER_ALLOCATOR.empty;
   static final long CHUNK_SIZE = INNER_ALLOCATOR.getChunkSize();
 
-  private final int allocatedSize;
+  private final long allocatedSize;
   private final UnsafeDirectLittleEndian memoryChunk;
+  private final long allocatedAddress;
 
-  NettyAllocationManager(BaseAllocator accountingAllocator, int requestedSize) 
{
+  NettyAllocationManager(BaseAllocator accountingAllocator, long 
requestedSize) {
     super(accountingAllocator);
-    this.memoryChunk = INNER_ALLOCATOR.allocate(requestedSize);
-    this.allocatedSize = memoryChunk.capacity();
-  }
-
-  /**
-   * Get the underlying memory chunk managed by this AllocationManager.
-   * @return buffer
-   */
-  UnsafeDirectLittleEndian getMemoryChunk() {
-    return memoryChunk;
+    if (requestedSize > Integer.MAX_VALUE) {
+      memoryChunk = null;
+      allocatedAddress = PlatformDependent.allocateMemory(requestedSize);
+    } else {
+      this.memoryChunk = INNER_ALLOCATOR.allocate(requestedSize);
+      allocatedAddress = memoryChunk.memoryAddress();

Review comment:
       Sure. Revised. Please check. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to