zjuwangg commented on code in PR #48963:
URL: https://github.com/apache/spark/pull/48963#discussion_r1867645700


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -479,6 +479,32 @@ private[spark] object CoarseGrainedExecutorBackend extends 
Logging {
       driverConf.set(EXECUTOR_ID, arguments.executorId)
       cfg.logLevel.foreach(logLevel => Utils.setLogLevelIfNeeded(logLevel))
 
+      // Set executor memory related config here according to resource profile
+      if (cfg.resourceProfile.id != 
ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) {
+        cfg.resourceProfile
+          .executorResources
+          .foreach {
+            case (ResourceProfile.OFFHEAP_MEM, request) =>
+              driverConf.set(MEMORY_OFFHEAP_SIZE.key, request.amount.toString 
+ "m")
+              if (request.amount > 0) {
+                driverConf.set(MEMORY_OFFHEAP_ENABLED.key, "true")

Review Comment:
   > Thank you very much for this PR, we just encountered this problem. Is the 
logic of resetting the offheap configuration better this way?
   > 
   > ```
   > case (ResourceProfile.OFFHEAP_MEM, request)  if  request.amount > 0 =>
   >        driverConf.set(MEMORY_OFFHEAP_SIZE.key, request.amount.toString + 
"m")
   >        driverConf.set(MEMORY_OFFHEAP_ENABLED.key, "true")
   > ```
   @xumanbu 
   I think this is incorrect. Imagine such a scenario where default resource 
profile's offheap is 512M, and resource profile with id 2 's offheap is 0, in 
such case the offheap config will be incorrect!



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