GitHub user peterableda opened a pull request:

    https://github.com/apache/spark/pull/12395

    Add minimum memory checks for drivers and executors

    ## What changes were proposed in this pull request?
    
    Implement the same memory size validations for the StaticMemoryManager 
(Legacy) as the UnifiedMemoryManager has. 
    
    ## How was this patch tested?
    
    Manual tests were done in CDH cluster.
    
    Test with small executor memory:
    `
    spark-submit --class org.apache.spark.examples.SparkPi --deploy-mode client 
--master yarn --executor-memory 15m --conf spark.memory.useLegacyMode=true 
/opt/cloudera/parcels/CDH/lib/spark/examples/lib/spark-examples*.jar 10
    `
    
    Exception thrown:
    ```
    ERROR spark.SparkContext: Error initializing SparkContext.
    java.lang.IllegalArgumentException: Executor memory 15728640 must be at 
least 471859200. Please increase executor memory using the --executor-memory 
option or spark.executor.memory in Spark configuration.
        at 
org.apache.spark.memory.StaticMemoryManager$.org$apache$spark$memory$StaticMemoryManager$$getMaxExecutionMemory(StaticMemoryManager.scala:127)
        at 
org.apache.spark.memory.StaticMemoryManager.<init>(StaticMemoryManager.scala:46)
        at org.apache.spark.SparkEnv$.create(SparkEnv.scala:352)
        at org.apache.spark.SparkEnv$.createDriverEnv(SparkEnv.scala:193)
        at org.apache.spark.SparkContext.createSparkEnv(SparkContext.scala:289)
        at org.apache.spark.SparkContext.<init>(SparkContext.scala:462)
        at org.apache.spark.examples.SparkPi$.main(SparkPi.scala:29)
        at org.apache.spark.examples.SparkPi.main(SparkPi.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
        at 
org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
        at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
    ```
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/peterableda/spark SPARK-14636

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/12395.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #12395
    
----
commit 555dadad967275f2f2c96e6eb00fa0a419debc16
Author: Peter Ableda <[email protected]>
Date:   2016-04-14T14:10:56Z

    Add minimum memory checks for drivers and executors

----


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to