LakshSingla commented on code in PR #15987:
URL: https://github.com/apache/druid/pull/15987#discussion_r1513916528
##########
processing/src/main/java/org/apache/druid/frame/allocation/AppendableMemory.java:
##########
@@ -136,7 +136,7 @@ public boolean reserveAdditional(final int bytes)
// Allocation needed.
// Math.max(allocationSize, bytes) in case "bytes" is greater than
SOFT_MAXIMUM_ALLOCATION_SIZE.
final Optional<ResourceHolder<WritableMemory>> newMemory =
- allocator.allocate(Math.max(nextAllocationSize, bytes));
+ allocator.allocate(Math.min(allocator.available(),
Math.max(nextAllocationSize, bytes)));
Review Comment:
Added a comment in the code to clarify.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]