title: How to increase Java heap space on Spark Amazon EC2 cluster?
body: <p>I wrote a program using Java Spark API. Given my data is big, I am getting the following error</p>
  
  <blockquote>
    <p>java.lang.OutOfMemoryError: Java heap space</p>
  </blockquote>
  
  <p>Any idea how to increase java heap space of Spark EC2 cluster on Aws? I can give details about my code and cluster setup if necessary. Thanks. </p>