Github user uncleGen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15915#discussion_r91880781
  
    --- Diff: core/src/main/scala/org/apache/spark/memory/MemoryManager.scala 
---
    @@ -223,8 +222,10 @@ 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.getSizeAsBytes("spark.buffer.pageSize", default)
    +    val maxPageSize = math.min(64L * minPageSize, math.max(minPageSize, 
size))
    +    val userSetting = conf.getSizeAsBytes("spark.buffer.pageSize")
    +    // In case of too large page size.
    +    math.min(userSetting, maxPageSize)
       }
    --- End diff --
    
    @JoshRosen The `SparkEnv.memoryManager.pageSizeBytes` returns `Long`, if we 
reuse it as chunk size, there is still underlying integer overflow, isn't it? 
Here, I restricted the upper limit of page size in case of too large.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to