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 <cnbi...@gmail.com <javascript:>> 
> 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 <cnbi...@gmail.com> 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.
>>>
>> So when I start a new Julia process, the tally starts at zero?
>>
>
> The GC uses a number of counters to decide when to do a collection. They 
> are maintained differently and "start at zero" is almost a meaningless. 
> They are independent and almost start in the same state.
>  
>
>>  
>>
>>>  
>>>
>>>> 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?
>>>>
>>>
>>> Neither
>>>
>> How can it be neither?  What can be a third choice with this question?
>>
>
> Nothing is cleared. Dead objects are collected to be reused later without 
> clearing.
>  
>
 
When GC does a pass, does it collect everything so the tally is set to 
zero, or does it do a partial collection?
 

>  
>>
>>>  
>>>
>>>> 3) I presume it is the latter case in question 2).  So does GC clear 
>>>> out things on first-in-first-out bases or what?
>>>>
>>>
>>> Not applicable.
>>>
>>
I presume it is the latter case in question 2).  So does GC collect things 
on first-in-first-out bases or what?
 

>  
>>>
>>>> 4) When the tally becomes big enough, does GC make sure to keep objects 
>>>> that are referenced for future use in (Julia) code?
>>>>
>>>
>>> See the link below
>>>  
>>>
>>>> 5) Do local objects (things allocated and only used within functions 
>>>> for instance) get cleared out immediately when the functions terminate so 
>>>> they don't take up quota in the tally?
>>>>
>>>>
>>> No
>>>
>> Or perhaps those local objects have higher priorities of getting cleared 
>> out?
>>
>
> No.
>

 Do local objects (things allocated and only used within functions for 
instance) get collected immediately when the functions terminate so they 
don't take up quota in the tally?  Or perhaps those local objects have 
higher priorities of getting collected?

 
>
>>  
>>
>>>  
>>>
>>>
>>> Please check https://en.wikipedia.org/wiki/Tracing_garbage_collection 
>>> for basic concepts related to garbage collection.
>>>
>>>  
>>>
>>>>
>>>>

Reply via email to