RFR (M): 8129558: Coalesce dead objects during removal of self-forwarded pointers

Tony Printezis tprintezis at twitter.com
Thu Jun 25 20:06:20 UTC 2015


Thomas,

Inline, towards the end.

On June 25, 2015 at 2:18:36 PM, Thomas Schatzl (thomas.schatzl at oracle.com) wrote:

Hi Tony, 

On Thu, 2015-06-25 at 12:35 -0400, Tony Printezis wrote: 
> Thomas, 
> 
> 
> One nit and one question: 
> 
> 
> 144 // Fill the memory area from start to end with a dead object, and update the BOT 
> 145 // and the mark bitmap. 
> 146 void zap_dead_objects(HeapWord* start, HeapWord* end) { 
> 
> 
> the nit: The comment should now be “with dead objects” (and I’d prefer 
> "with filler objects”) instead of “with dead object” given that 
> fill_with_objects(), called from zap_dead_objects(), might place up to 
> two objects in the area (given your previous change, right?). 

Will fix that. 
> 
> the (related) question: Do you set the BOT for [start, end) assuming 
> one filler object but in reality [start, end) might have two objects? 
> I looked at the code for cross_threshold() / BOT::alloc_block() and it 
> looks as if they set up the BOT as if [start, end) is covered by a 
> single object (but I could have misread the code). This will result in 
> some (most likely very rare) cases where BOT look-ups will do more 
> work than they should. Should you do fill_with_objects() first, then 
> iterate over the filler objects, and update the BOT for each? 

You are right about this. However considering these are going to be dead 
objects, they will never be iterated over using the BOT in performance 
sensitive code. 


I agree. But isn’t there an edge case? Imagine you have the sequence of D* dead objects, followed by A (a live object):

D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 A

Let’s say your code replaces the D* dead objects with two filler objects, F0 and F1:

F0 F1 A

If A’s start is in the middle of a card, in order to scan that card, won’t the BOT do more work to find the first object on that card given that it will have to look-up F0 which is further away? Also, note that the BOT look-up for A will actually NOT return the first object on that card (F0). Will that break any asserts?

Tony






I need to check though if some verification code might not like this 
situation. 

Maybe I can find some good fix for that. 

Thanks, 
Thomas 




-----

Tony Printezis | JVM/GC Engineer / VM Team | Twitter

@TonyPrintezis
tprintezis at twitter.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20150625/a7cfe91a/attachment.html>


More information about the hotspot-gc-dev mailing list