zhztheplayer commented on code in PR #6869:
URL: https://github.com/apache/incubator-gluten/pull/6869#discussion_r1744879030


##########
cpp/velox/shuffle/VeloxSortShuffleWriter.cc:
##########
@@ -106,8 +104,17 @@ arrow::Status VeloxSortShuffleWriter::init() {
       options_.partitioning == Partitioning::kSingle,
       arrow::Status::Invalid("VeloxSortShuffleWriter doesn't support single 
partition."));
   allocateMinimalArray();
-  sortedBuffer_ = 
facebook::velox::AlignedBuffer::allocate<char>(kSortedBufferSize, 
veloxPool_.get());
-  rawBuffer_ = sortedBuffer_->asMutable<uint8_t>();
+  // In Spark, sortedBuffer_ memory and compressionBuffer_ memory are 
pre-allocated and counted into executor
+  // memory overhead. To align with Spark, we use arrow::default_memory_pool() 
to avoid counting these memory in Gluten.

Review Comment:
   I think the code looks fine now as we don't have a mechanism to count global 
allocation of Arrow into Spark overhead memory. 
   
   In future we may report both Arrow and Velox's global pool usages to one 
counter which requires for some designs. So far we don't have that.



-- 
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]

Reply via email to