title: Spark-submit in Spark stand alone - all memory gone to the drivers
body: <p>I have setup a Spark standalone cluster, where I can submit jobs with spark-submit:</p>
  
  <p><code>
  spark-submit \
    --class blah.blah.MyClass \
    --master spark://myaddress:6066 \
    --executor-memory 8G \
    --deploy-mode cluster \
    --total-executor-cores 12 \
    /path/to/jar/myjar.jar
  </code></p>
  
  <p>Problem is when I send multiple jobs at the same time, say over 20 in one go, the first few finished successfully. All the others are now stuck waiting for resources. I noticed all the available memory has gone to the drivers, so in the drivers section they are all running but in the running application section they all are in WAITING state.</p>
  
  <p>How can I tell spark stand alone to first allocate memory to the WAITING executors instead of the SUBMITTED drivers?</p>
  
  <p>thank you</p>
  
  <p>Below is an extract of my spark-defaults.conf
  <code>
      spark.master                     spark://address:7077
      spark.eventLog.enabled           true
      spark.eventLog.dir               /path/tmp/sparkEventLog
      spark.driver.memory              5g
      spark.local.dir                  /path/tmp
      spark.ui.port                    xxx
  </code></p>