dongjoon-hyun commented on a change in pull request #34846:
URL: https://github.com/apache/spark/pull/34846#discussion_r767223431



##########
File path: core/src/main/scala/org/apache/spark/memory/MemoryManager.scala
##########
@@ -255,7 +256,14 @@ private[spark] abstract class MemoryManager(
     }
     val size = ByteArrayMethods.nextPowerOf2(maxTungstenMemory / cores / 
safetyFactor)
     val default = math.min(maxPageSize, math.max(minPageSize, size))
-    conf.get(BUFFER_PAGESIZE).getOrElse(default)
+    val sizeAsBytes = conf.get(BUFFER_PAGESIZE).getOrElse(default)
+    if (Utils.isG1GarbageCollector &&
+      tungstenMemoryMode == MemoryMode.ON_HEAP &&
+      sizeAsBytes % (1024 * 1024) == 0) {
+      sizeAsBytes - Platform.LONG_ARRAY_OFFSET

Review comment:
       Could you update the function description with this new addition?




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