Re: [rvm-research] Question regarding the sanity checker
Robin Garner <[email protected]> Tue, 28 Mar 2017 14:17:16 +1100
| Newsgroups | gmane.comp.java.jikes.rvm.devel |
|---|---|
| Message-ID | <[email protected]> |
On 28/03/17 05:23, Shoaib Akram wrote: > Thank you Robin for your answer. I went through the code again and I fully understand the point (b) below. Sanity checker does a full-heap trace after collection and builds a table of all reachable objects. And then inquires the current collection plan the expected RC, making sure the plan’s view matches with it’s own. But I am still confused how it ensures (a). It discards the table built during the Pre-GC phase, and builds a new table in the Post-GC. What it could ensure is the number of live objects before and after collection is the same. But how does it ensure every object reachable before collection is still reachable after collection? If you've checked the code then your impression is probably correct and I'm misremembering. Before and after comparison is definitely something that the MMTk Harness sanity checker definitely does, so that's probably the source of my confusion. Can I suggest that you try the MMTk Harness ? Regards, Robin >> On Mar 27, 2017, at 4:59 AM, Robin Garner <[email protected]> wrote: >> >> >> >> 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 > > ------------------------------------------------------------------------------ > 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