[julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread K leo
Let's say in REPL you define an object, then after many many other operations, Julia's GC wouldn't free the object you defined earlier until you exit Julia or you somehow really run out of memory or something. Is that the correct understanding? Now I am trying to think what happens with the jl

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 10:05 AM, K leo wrote: > Let's say in REPL you define an object, then after many many other > operations, Julia's GC wouldn't free the object you defined earlier until > you exit Julia or you somehow really run out of memory or something. Is > that the correct understandi

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Tim Holy
Every time julia allocates memory, it adds the number of bytes to a running tally; once that tally gets big enough, it does a garbage-collection pass (and resets the tally). Consequently GC is triggered only when you allocate, but even the smallest allocation can trigger GC if it pushes the t

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 12:16 PM, Tim Holy wrote: > Every time julia allocates memory, it adds the number of bytes to a > running tally; once that tally gets big enough, it does a > garbage-collection pass (and resets the tally). Consequently GC is > triggered only when you allocate, but even the

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread K leo
Thanks for the reply. A couple questions: 1) When I quit Julia and do a fresh start, is the tally set to zero? 2) When GC does a pass, does it clear out everything so the tally is set to zero, or does it do a partial clearance? 3) I presume it is the latter case in question 2). So does GC clear

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 6:46 PM, K leo wrote: > Thanks for the reply. A couple questions: > > 1) When I quit Julia and do a fresh start, is the tally set to zero? > Memory in different processes are totally unrelated. > 2) When GC does a pass, does it clear out everything so the tally is set

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread K leo
On Sunday, September 11, 2016 at 7:35:41 AM UTC+8, Yichao Yu wrote: > > > > On Sat, Sep 10, 2016 at 6:46 PM, K leo > > wrote: > >> Thanks for the reply. A couple questions: >> > >> 1) When I quit Julia and do a fresh start, is the tally set to zero? >> > > Memory in different processes are tot

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread Yichao Yu
On Sat, Sep 10, 2016 at 8:00 PM, K leo wrote: > > > On Sunday, September 11, 2016 at 7:35:41 AM UTC+8, Yichao Yu wrote: >> >> >> >> On Sat, Sep 10, 2016 at 6:46 PM, K leo wrote: >> >>> Thanks for the reply. A couple questions: >>> >> >>> 1) When I quit Julia and do a fresh start, is the tally s

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-10 Thread K leo
Thanks for clearing. I see that I used wrong word, "clear" instead of "collect". Then can I rephrase my questions below: On Sunday, September 11, 2016 at 9:31:35 AM UTC+8, Yichao Yu wrote: > > > > On Sat, Sep 10, 2016 at 8:00 PM, K leo > > wrote: > >> >> >> On Sunday, September 11, 2016 at 7:3

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-11 Thread Yichao Yu
> > When GC does a pass, does it collect everything so the tally is set to > zero, or does it do a partial collection? > It only collect dead objects (so not everything) although some counters are reset to zero. > I presume it is the latter case in question 2). So does GC collect things > on fi

Re: [julia-users] How does garbage collection really work in Julia?

2016-09-11 Thread Páll Haraldsson
On Sunday, September 11, 2016 at 3:12:37 AM UTC, K leo wrote: > > Thanks for clearing. I see that I used wrong word, "clear" instead of > "collect". Then can I rephrase my questions below: > > On Sunday, September 11, 2016 at 9:31:35 AM UTC+8, Yichao Yu wrote: >> >> >> >> On Sat, Sep 10, 2016 at