launched executors are less than number of executors specified
<p>I have EMR cluster with following configuration:</p>

<pre><code>        Number of cores, RAM(GB),  yarn.nodemanager.resource.memory-mb(MB)
Master:         4          15          11532
core(slave1):   16         30          23040
core(slave2):   16         30          23040
core(slave3):   16         30          23040
core(slave4):   16         30          23040
</code></pre>

<p>I am starting a spark application with one job that gets divided into 2 stages using --master yarn-client with following configurations:</p>

<pre><code>--num-executors 12 --executor-cores 5 --executor-memory 7G ----&gt;(1)
--num-executors 12 --executor-cores 5 --executor-memory 6G ----&gt;(2)
</code></pre>

<p>I have not modified any other parameter so spark.storage.* and spark.shuffle.* fractions are default.</p>

<p>calculations that I performed to find above configuration (master node is not performing any computation i.e verified using Ganglia except serving as a driver) are:</p>

<pre><code>1. allocated 15 cores to yarn per node and started 3 executors/node 
   which implies 4(# of slave nodes)*3 = 12 executors. 
2. 15 cores/3 executors = 5 cores per executor
3. 23040*(1-0.07) ~ 21G. Dividing this among three executors i.e
   21/3=7G
</code></pre>

<p>In the (1) configuration, it is not launching 12 executors whereas in the (2) case it is able to do so. Though the memory is available per executor to do so, why it is not able to launch 12 executors in the (1) case? </p>