You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/17 12:32:44 UTC

[GitHub] [spark] hvanhovell commented on a change in pull request #29785: [SPARK-32901][CORE] Do not allocate memory while spilling UnsafeExternalSorter

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org