title: how to limit the number of concurrent map tasks per executor?
body: <p>A map operation in my Spark APP takes an <code>RDD[A]</code> as input and map each element in <code>RDD[A]</code> using a custom mapping function <code>func(x:A):B</code> to another object of type B. Because <code>func()</code> requires significant amount of memory when computing each input <code>x</code>, I want to limit the number of concurrent map tasks per executor such that the total amount of memory required by all tasks on the same executor does not exceeds the amount of physical memory available on the node.</p>
  
  <p>I checked out available spark configurations, but not sure which one to use. Does using <code>coalesce(numPartitions)</code> to set the number of partitions for <code>RDD[A]</code> fulfil the purpose?</p>