Re: Unpersist RDD in Graphx
Hi, Please call "Graph#unpersist" that releases two RDDs, vertex and edge ones. "Graph#unpersist" just invokes "Graph#unpersistVertices" and "Graph#edges#unpersist"; "Graph#unpersistVertices" releases memory for vertices and "Graph#edges#unpersist" does memory for edges. If blocking = true, unpersist() waits until memory released from BlockManager. On Mon, Feb 1, 2016 at 8:35 AM, Zhang, Jingyuwrote: > Hi, What is he best way to unpersist the RDD in graphx to release memory? > RDD.unpersist > or > RDD.unpersistVertices and RDD..edges.unpersist > > I study the source code of Pregel.scala, Both of above were used between > line 148 and line 150. Can anyone please tell me what the different? In > addition, what is the difference to set blocking = false and blocking = > true? > > oldMessages.unpersist(blocking = false) > prevG.unpersistVertices(blocking = false) > prevG.edges.unpersist(blocking = false) > > Thanks, > > Jingyu > > This message and its attachments may contain legally privileged or > confidential information. It is intended solely for the named addressee. If > you are not the addressee indicated in this message or responsible for > delivery of the message to the addressee, you may not copy or deliver this > message or its attachments to anyone. Rather, you should permanently delete > this message and its attachments and kindly notify the sender by reply > e-mail. Any content of this message and its attachments which does not > relate to the official business of the sending company must be taken not to > have been sent or endorsed by that company or any of its related entities. > No warranty is made that the e-mail or attachments are free from computer > virus or other defect. -- --- Takeshi Yamamuro
Re: unpersist RDD from another thread
So in order to not incur any performance issues I should really wait for all usage of the rdd to complete before calling unpersist, correct? On Wed, Sep 16, 2015 at 4:08 PM, Tathagata Daswrote: > unpredictable. I think it will be safe (as in nothing should fail), but > the performance will be unpredictable (some partition may use cache, some > may not be able to use the cache). > > On Wed, Sep 16, 2015 at 1:06 PM, Paul Weiss > wrote: > >> Hi, >> >> What is the behavior when calling rdd.unpersist() from a different thread >> while another thread is using that rdd. Below is a simple case for this: >> >> 1) create rdd and load data >> 2) call rdd.cache() to bring data into memory >> 3) create another thread and pass rdd for a long computation >> 4) call rdd.unpersist while 3. is still running >> >> Questions: >> >> * Will the computation in 3) finish properly even if unpersist was called >> on the rdd while running? >> * What happens if a part of the computation fails and the rdd needs to >> reconstruct based on DAG lineage, will this still work even though >> unpersist has been called? >> >> thanks, >> -paul >> > >
Re: unpersist RDD from another thread
Yes. On Wed, Sep 16, 2015 at 1:12 PM, Paul Weisswrote: > So in order to not incur any performance issues I should really wait for > all usage of the rdd to complete before calling unpersist, correct? > > On Wed, Sep 16, 2015 at 4:08 PM, Tathagata Das < > tathagata.das1...@gmail.com> wrote: > >> unpredictable. I think it will be safe (as in nothing should fail), but >> the performance will be unpredictable (some partition may use cache, some >> may not be able to use the cache). >> >> On Wed, Sep 16, 2015 at 1:06 PM, Paul Weiss >> wrote: >> >>> Hi, >>> >>> What is the behavior when calling rdd.unpersist() from a different >>> thread while another thread is using that rdd. Below is a simple case for >>> this: >>> >>> 1) create rdd and load data >>> 2) call rdd.cache() to bring data into memory >>> 3) create another thread and pass rdd for a long computation >>> 4) call rdd.unpersist while 3. is still running >>> >>> Questions: >>> >>> * Will the computation in 3) finish properly even if unpersist was >>> called on the rdd while running? >>> * What happens if a part of the computation fails and the rdd needs to >>> reconstruct based on DAG lineage, will this still work even though >>> unpersist has been called? >>> >>> thanks, >>> -paul >>> >> >> >
Re: Unpersist
like this? var temp = ... for (i - num) { temp = .. { do something } temp.unpersist() } Thanks Best Regards On Thu, Sep 11, 2014 at 3:26 PM, Deep Pradhan pradhandeep1...@gmail.com wrote: I want to create a temporary variables in a spark code. Can I do this? for (i - num) { val temp = .. { do something } temp.unpersist() } Thank You
Re: Unpersist
After every loop I want the temp variable to cease to exist On Thu, Sep 11, 2014 at 4:33 PM, Akhil Das ak...@sigmoidanalytics.com wrote: like this? var temp = ... for (i - num) { temp = .. { do something } temp.unpersist() } Thanks Best Regards On Thu, Sep 11, 2014 at 3:26 PM, Deep Pradhan pradhandeep1...@gmail.com wrote: I want to create a temporary variables in a spark code. Can I do this? for (i - num) { val temp = .. { do something } temp.unpersist() } Thank You