File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
java/memory/memory-core/src/main/java/org/apache/arrow/memory Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -369,8 +369,12 @@ boolean transferBalance(final ReferenceManager targetReferenceManager) {
369369 targetReferenceManager .getAllocator ().getName ());
370370 }
371371
372- boolean overlimit = targetAllocator .forceAllocate (memoryChunkManager .getSize ());
373- allocator .releaseBytes (memoryChunkManager .getSize ());
372+ long size = memoryChunkManager .getSize ();
373+ targetAllocator .getListener ().onPreAllocation (size );
374+ boolean overlimit = targetAllocator .forceAllocate (size );
375+ targetAllocator .getListener ().onAllocation (size );
376+ allocator .releaseBytes (size );
377+ allocator .getListener ().onRelease (size );
374378 // since the transfer can only happen from the owning reference manager,
375379 // we need to set the target ref manager as the new owning ref manager
376380 // for the chunk of memory in MemoryChunkManager
You can’t perform that action at this time.
0 commit comments