Details
-
Sub-task
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.8.0
-
None
-
None
Description
The external sort contains rather complex code to allocate an sv2 in the method newSV2(). The code tries to allocate an sv2. If the allocation fails, the code attempts to spill (which is fine) and try again. If things still fail, the code waits 1 sec. and tries again. It will continue to wait up to a minute, doubling the wait time each cycle.
Presumably, this is so that some other part of Drill will release memory. But, because of the way the allocator currently works, the allocation is limited by the limit set on the external sort's own allocator. This limit won't change by waiting.
The loop only makes sense if the memory allocation failed because the external sort's allocator is not above its limit, but the parent can't provide memory.
In practice, this scenario should not occur once the external sort is resource managed, so the retry code can simply be removed.