title: Caching a large stream
body: <p>I am working on a streaming application, which I am caching a large RDD (that is only in memory)..</p>
  
  <pre><code>Dstream.cache()
  Dstream.foreachRDD(..)
  Dstream.foreachRDD(..)
  </code></pre>
  
  <p>I wanted to know if the Dstream can not be fit into the memory..Is the RDD recomputed or raise an exception?</p>
  
  <p>I am asking this question since I am developing a stateful application using mapwithState function which internally uses an internal stream which is presisted only in memory.(<a href="https://github.com/wliuxad/spark/blob/master/streaming/src/main/scala/org/apache/spark/streaming/dstream/MapWithStateDStream.scala#L109-109" rel="nofollow noreferrer">https://github.com/wliuxad/spark/blob/master/streaming/src/main/scala/org/apache/spark/streaming/dstream/MapWithStateDStream.scala#L109-109</a>)</p>