title: How does SPARK read data and manage in Memory
body: <p>Can anyone please help me understanding how does SPARK read hdfs data and manage it in main memory?</p>
  
  <p>In other words,</p>
  
  <p>If I create 3 RDD, first RDD from hadoop file and do some transformation on it and create a second RDD and again do some transformation on the 2nd RDD and create a 3rd RDD then call some action on 3rd RDD.</p>
  
  <ol>
  <li>How many times data will be read from hdfs?</li>
  <li>Will all three RDD data stay in Memory if we don't call the cache or persist explicitly? i.e. when an action is executing on the 3rd RDD that time whether 1st RDD data remains in memory </li>
  </ol>