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/02/11 13:38:00 UTC

[GitHub] [spark] srowen commented on a change in pull request #34846: [SPARK-37593][CORE] Optimize HeapMemoryAllocator to avoid memory waste when using G1GC

srowen commented on a change in pull request #34846:
URL: https://github.com/apache/spark/pull/34846#discussion_r804655594



##########
File path: core/src/main/scala/org/apache/spark/memory/MemoryManager.scala
##########
@@ -254,10 +259,16 @@ private[spark] abstract class MemoryManager(
       case MemoryMode.OFF_HEAP => offHeapExecutionMemoryPool.poolSize
     }
     val size = ByteArrayMethods.nextPowerOf2(maxTungstenMemory / cores / safetyFactor)
-    val default = math.min(maxPageSize, math.max(minPageSize, size))
-    conf.get(BUFFER_PAGESIZE).getOrElse(default)
+    val choosedPageSize = math.min(maxPageSize, math.max(minPageSize, size))

Review comment:
       Total nit, but choosed -> chosen

##########
File path: core/src/main/scala/org/apache/spark/util/Utils.scala
##########
@@ -3232,6 +3232,24 @@ private[spark] object Utils extends Logging {
       case _ => math.max(sortedSize(len / 2), 1)
     }
   }
+
+  /**
+   * Return whether we are using G1GC or not
+   */
+  val isG1GC: Boolean = {

Review comment:
       This is OK here, though if it's only used here, maybe leave it in MemoryManager until it has reason to be shared? Utils is quite big already




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