Re: [rvm-research] Question regarding the sanity checker

Robin Garner <[email protected]> Mon, 27 Mar 2017 13:59:11 +1100
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <[email protected]>

On 25/03/17 08:14, Shoaib Akram wrote:
> Hi All,
>
> I am using the Jikes’s built-in sanity checker as an aid to debug a new collector I am writing. I have a question regarding the sanityExpectedRC() method in Gen.java. I notice that this method uses the isReachable() method of the corresponding space class to determine the liveness of a mature object during a full-heap collection. The isReachable() method for a moving mature space like Immix would return ALIVE if an object has the correct mark state or it has been forwarded. I am wondering why should the sanity checker visit a forwarded object in the first place.
The function of the sanity checker (in a non-RC heap) is to ensure that
a) every object that was reachable before the collection is reachable 
afterwards, and
b) that various claims (such as isReachable) that MMTk makes about the 
reachable objects are consistent with the sanity checker's view.

In order to do this, the sanity checker performs a full heap traversal 
on every GC.
> Also part of my confusion is that for the nursery objects, it always returns DEAD (after the collection) even though many nursery objects are also forwarded.
By definition, at the end of a collection, all nursery objects are dead, 
so this claim would seem to me to be correct.  The question is why the 
sanity checker would encounter pointers to nursery objects at all - this 
would seem to be an error.
> My problem is that if I introduce a new generation between the nursery and the mature space, and I use an instance of a moving space for this generation (say Immix), then should I return ALIVE for only objects having the correct mark state or also include those having the forwarding pointer set.
You should only return ALIVE for objects that are alive in the relevant 
space, not for the (dead) copies of objects that have been moved.
> Can anyone who knows how the sanity checker works shed some light. Thanks :)

Hope this helps,
Robin
>
> Regards,
> Shoaib.
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Jikesrvm-researchers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers