Question about GC

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about GC

Mariano Martinez Peck
 
Hi. I have been trying to understand a little how the Squeak GC works, and there is something very basic I don't understand. GC is supposed to start from the rootTable and mark all the objects that are reachable. This objects, includes those which are in the "old space".  I mean, the old objects too.

The problem is that I don't find where in the code is that. If i look to ObjectMemory >> markAndTrace: oop    I see:

(self oop: oop isGreaterThanOrEqualTo: youngStart)
        ifTrue: [ header := header bitOr: MarkBit ].  "mark only if young"



So...it is only marked if young.

Then, in ObjectMemory >> startObj   I see

    (self oop: oop isLessThan: youngStartLocal)
        ifTrue: ["old object; skip it"
            field := oop.
            ^ Upward].


So....where are the old objects being marked ?

Thanks in advance.

Mariano
Reply | Threaded
Open this post in threaded view
|

Re: Question about GC

Mariano Martinez Peck
 
Ok....now I found something very hacky :)

Reading a Squeak blue book, it says "Squeak simply forces de system to believe that the old/new boundary is at the bottom of the old region. Thus, the entire image is now considered to be new objects, and all objects will be fully traced."

Cheers

Mariano

On Fri, Apr 2, 2010 at 1:22 PM, Mariano Martinez Peck <[hidden email]> wrote:
Hi. I have been trying to understand a little how the Squeak GC works, and there is something very basic I don't understand. GC is supposed to start from the rootTable and mark all the objects that are reachable. This objects, includes those which are in the "old space".  I mean, the old objects too.

The problem is that I don't find where in the code is that. If i look to ObjectMemory >> markAndTrace: oop    I see:

(self oop: oop isGreaterThanOrEqualTo: youngStart)
        ifTrue: [ header := header bitOr: MarkBit ].  "mark only if young"



So...it is only marked if young.

Then, in ObjectMemory >> startObj   I see

    (self oop: oop isLessThan: youngStartLocal)
        ifTrue: ["old object; skip it"
            field := oop.
            ^ Upward].


So....where are the old objects being marked ?

Thanks in advance.

Mariano