title: Increase Java Heap Size in Spark on Yarn
body: <p>How can I increase Java Heap Space using Spark on Yarn's extra java options?</p>
  
  <p>This code is what I have so far that works:</p>
  
  <pre><code>./bin/spark-shell --master yarn-client --num-executors 10 --executor-memory 4g
  </code></pre>
  
  <p>This is what does not work:</p>
  
  <pre><code>./bin/spark-shell --master yarn-client --num-executors 10 --executor-memory 4g --extrajavaoptions '-Xmx2g'
  </code></pre>
  
  <p>I want to add spark.yarn.am.extraJavaOptions. The default is none. I know it should be a string of extra JVM options to pass to the YARN Application Master in client mode. I want to input something like -Xmx2g. Can anyone tell me what I am doing wrong please?</p>