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 2022/12/05 18:18:40 UTC

[GitHub] [spark] pan3793 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

pan3793 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1039928534


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of
+      // org.apache.spark.network.client.TransportClientFactory
+      val sharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.sharedByteBufAllocators.enabled", true)
+      val preferDirectBufsForSharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.io.preferDirectBufs", true)
+      val preferDirectBufs =
+        env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true)

Review Comment:
   The spark preferDirectBufs affects the created `ByteBufAllocator`, see `org.apache.spark.network.util#createPooledByteBufAllocator`, when spark's `preferDirectBufs=false` and `PlatformDependent.directBufferPreferred()=true`, a `PreferHeapByteBufAllocator` will be created.
   
   Heap memory will be used unless call `PreferHeapByteBufAllocator#directBuffer` directly, I don't see any code of shuffle client calls that method.



-- 
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: reviews-unsubscribe@spark.apache.org

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