hvanhovell commented on a change in pull request #29785:
URL: https://github.com/apache/spark/pull/29785#discussion_r490206060



##########
File path: 
core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java
##########
@@ -339,29 +342,43 @@ public void cleanupResources() {
   private void growPointerArrayIfNecessary() throws IOException {
     assert(inMemSorter != null);
     if (!inMemSorter.hasSpaceForAnotherRecord()) {
+      if (inMemSorter.numRecords() <= 0) {

Review comment:
       The inMemSorter currently preallocates memory in its constructor right? 
What happens to that memory when we hit this block? I think it leaks :)... BTW 
shouldn't we just check whether the inMemorySorter has memory allocated?




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to