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

    https://github.com/apache/spark/pull/377#discussion_r11500001
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -1022,4 +1022,13 @@ private[spark] object Utils extends Logging {
       def getHadoopFileSystem(path: URI): FileSystem = {
         FileSystem.get(path, SparkHadoopUtil.get.newConfiguration())
       }
    +
    +  /**
    +   * Determine the system's effective maximum memory after taking into 
account
    +   * `spark.system.reservedMemorySize`
    +   */
    +  def effectiveMaxMemory(conf: SparkConf) = {
    +    Runtime.getRuntime.maxMemory - (1024 * 1024 * 
    --- End diff --
    
    Also do you mind writing this as a two statements? The Scala style is to 
avoid multi-line expressions when possible:
    
    ```
    val reservedMemorySize = 
memoryStringToMb(conf.get("spark.system.reservedMemorySize", "300m"))
    Runtime.getRuntime.maxMemory - (1024 * 1024 * reservedMemorySize)
    ```


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to