wForget commented on code in PR #1379:
URL: https://github.com/apache/datafusion-comet/pull/1379#discussion_r1953672696


##########
spark/src/main/scala/org/apache/spark/Plugins.scala:
##########
@@ -62,7 +62,13 @@ class CometDriverPlugin extends DriverPlugin with Logging 
with ShimCometDriverPl
         Math.max((executorMemory * memoryOverheadFactor).toLong, 
memoryOverheadMinMib)
       }
 
-      val cometMemOverhead = 
CometSparkSessionExtensions.getCometMemoryOverheadInMiB(sc.getConf)
+      val cometMemOverhead =
+        if 
(!CometSparkSessionExtensions.cometUnifiedMemoryManagerEnabled(sc.getConf)) {
+          CometSparkSessionExtensions.getCometMemoryOverheadInMiB(sc.getConf)
+        } else {
+          // comet shuffle unified memory manager is disabled, so we need to 
add overhead memory
+          CometSparkSessionExtensions.getCometShuffleMemorySize(sc.getConf)

Review Comment:
   Since the previous shouldOverrideMemoryConf is true, this if branch means 
cometShuffleUnifiedMemoryManagerInTestEnabled is false. So we need to reserve 
some overhead memory for shuffle allocator that do not use unified memory 
manager.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to