[
https://issues.apache.org/jira/browse/DRILL-5758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16160517#comment-16160517
]
ASF GitHub Bot commented on DRILL-5758:
---------------------------------------
Github user Ben-Zvi commented on a diff in the pull request:
https://github.com/apache/drill/pull/932#discussion_r137963963
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/managed/SortMemoryManager.java
---
@@ -680,9 +680,11 @@ public MergeTask consolidateBatches(long allocMemory,
int inMemCount, int spille
// spilled run.
// Maximum spill batches that fit into available memory.
+ // Use the maximum buffer size since spill batches seem to
+ // be read with almost 50% internal fragmentation.
int memMergeLimit = (int) ((mergeMemoryLimit - allocMemory) /
- spillBatchSize.expectedBufferSize);
+ spillBatchSize.maxBufferSize);
memMergeLimit = Math.max(0, memMergeLimit);
--- End diff --
This line of code is not needed ( Math.max(....) ), as the code above
(around line 675) ensures that mergeMemoryLimit >= allocMemory .
> Rollup of external sort fixes to issues found by QA
> ---------------------------------------------------
>
> Key: DRILL-5758
> URL: https://issues.apache.org/jira/browse/DRILL-5758
> Project: Apache Drill
> Issue Type: Task
> Affects Versions: 1.12.0
> Reporter: Paul Rogers
> Assignee: Paul Rogers
> Fix For: 1.12.0
>
>
> Tracking JIRA to used for the PR that combines fixes for various JIRA
> entries. Bugs fixed in this task are given by the linked issues.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)